• 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

88.89
/src/KickStart.Unity/UnityServiceRegistration.cs
1
using KickStart.Services;
2

3
using Unity;
4
using Unity.Lifetime;
5

6
namespace KickStart.Unity;
7

8
/// <summary>
9
/// Unity implementation for <see cref="IServiceRegistration"/>.
10
/// </summary>
11
/// <seealso cref="IServiceRegistration" />
12
public class UnityServiceRegistration : ServiceRegistrationBase
13
{
14
    private readonly IUnityContainer _container;
15

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

26
    /// <summary>
27
    /// Registers a service of the type specified in <paramref name="serviceType" /> with an
28
    /// implementation of the type specified in <paramref name="implementationType" /> using
29
    /// the specified <paramref name="lifetime" />.
30
    /// </summary>
31
    /// <param name="serviceType">The type of the service to register.</param>
32
    /// <param name="implementationType">The implementation type of the service.</param>
33
    /// <param name="lifetime">The service lifetime.</param>
34
    /// <returns>
35
    /// A reference to this instance after the operation has completed.
36
    /// </returns>
37
    public override IServiceRegistration Register(Type serviceType, Type implementationType, ServiceLifetime lifetime)
38
    {
39
        var lifetimeManager = lifetime == ServiceLifetime.Singleton ? new ContainerControlledLifetimeManager() : null;
6✔
40
        _container.RegisterType(serviceType, implementationType, lifetimeManager);
6✔
41

42
        return this;
6✔
43
    }
44

45
    /// <summary>
46
    /// Registers a service of the type specified in <paramref name="serviceType" /> with a
47
    /// factory specified in <paramref name="implementationFactory" /> using
48
    /// the specified <paramref name="lifetime" />.
49
    /// </summary>
50
    /// <param name="serviceType">The type of the service to register.</param>
51
    /// <param name="implementationFactory">The factory that creates the service.</param>
52
    /// <param name="lifetime">The service lifetime.</param>
53
    /// <returns>
54
    /// A reference to this instance after the operation has completed.
55
    /// </returns>
56
    /// <seealso cref="F:KickStart.Services.ServiceLifetime.Singleton" />
57
    /// <exception cref="NotSupportedException">Not supported.</exception>
58
    public override IServiceRegistration Register(Type serviceType, Func<IServiceProvider, object> implementationFactory, ServiceLifetime lifetime)
59
    {
NEW
60
        throw new NotSupportedException();
×
61
    }
62
}
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

© 2025 Coveralls, Inc