• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

loresoft / KickStart / 17529667504

07 Sep 2025 02:14PM UTC coverage: 60.921%. Remained the same
17529667504

push

github

pwelter34
reformat code base

162 of 364 branches covered (44.51%)

Branch coverage included in aggregate %.

634 of 951 new or added lines in 72 files covered. (66.67%)

4 existing lines in 4 files now uncovered.

658 of 982 relevant lines covered (67.01%)

20.4 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.33
/src/KickStart.SimpleInjector/SimpleInjectorRegistration.cs
1
using KickStart.Services;
2

3
using SimpleInjector;
4

5
namespace KickStart.SimpleInjector;
6

7
/// <summary>
8
/// SimpleInjector implementation for <see cref="IServiceRegistration"/>.
9
/// </summary>
10
/// <seealso cref="IServiceRegistration" />
11
public class SimpleInjectorRegistration : ServiceRegistrationBase
12
{
13
    private readonly Container _container;
14

15
    /// <summary>
16
    /// Initializes a new instance of the <see cref="SimpleInjectorRegistration"/> class.
17
    /// </summary>
18
    /// <param name="container">The container.</param>
19
    /// <param name="serviceContext">The current service <see cref="Context"/>.</param>
20
    public SimpleInjectorRegistration(Context serviceContext, Container container) : base(serviceContext)
4✔
21
    {
22
        _container = container;
4✔
23
    }
4✔
24

25
    /// <summary>
26
    /// Registers a service of the type specified in <paramref name="serviceType" /> with an
27
    /// implementation of the type specified in <paramref name="implementationType" /> using
28
    /// the specified <paramref name="lifetime" />.
29
    /// </summary>
30
    /// <param name="serviceType">The type of the service to register.</param>
31
    /// <param name="implementationType">The implementation type of the service.</param>
32
    /// <param name="lifetime">The service lifetime.</param>
33
    /// <returns>
34
    /// A reference to this instance after the operation has completed.
35
    /// </returns>
36
    public override IServiceRegistration Register(Type serviceType, Type implementationType, ServiceLifetime lifetime)
37
    {
38
        if (lifetime == ServiceLifetime.Singleton)
50!
39
            _container.RegisterSingleton(serviceType, implementationType);
50✔
40
        else
NEW
41
            _container.Register(serviceType, implementationType);
×
42

43
        return this;
50✔
44
    }
45

46
    /// <summary>
47
    /// Registers a service of the type specified in <paramref name="serviceType" /> with a
48
    /// factory specified in <paramref name="implementationFactory" /> using
49
    /// the specified <paramref name="lifetime" />.
50
    /// </summary>
51
    /// <param name="serviceType">The type of the service to register.</param>
52
    /// <param name="implementationFactory">The factory that creates the service.</param>
53
    /// <param name="lifetime">The service lifetime.</param>
54
    /// <returns>
55
    /// A reference to this instance after the operation has completed.
56
    /// </returns>
57
    /// <seealso cref="F:KickStart.Services.ServiceLifetime.Singleton" />
58
    public override IServiceRegistration Register(Type serviceType, Func<IServiceProvider, object> implementationFactory, ServiceLifetime lifetime)
59
    {
60
        if (lifetime == ServiceLifetime.Singleton)
2!
NEW
61
            _container.RegisterSingleton(serviceType, () => implementationFactory(_container));
×
62
        else
63
            _container.Register(serviceType, () => implementationFactory(_container));
2✔
64

65
        return this;
2✔
66
    }
67
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc