• 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

87.18
/src/KickStart.SimpleInjector/SimpleInjectorStarter.cs
1
using KickStart.Services;
2

3
using SimpleInjector;
4

5
namespace KickStart.SimpleInjector;
6

7
/// <summary>
8
/// SimpleInjector KickStarter extension
9
/// </summary>
10
/// <seealso cref="KickStart.IKickStarter" />
11
public class SimpleInjectorStarter : IKickStarter
12
{
13
    private readonly SimpleInjectorOptions _options;
14

15
    /// <summary>
16
    /// Initializes a new instance of the <see cref="SimpleInjectorStarter"/> class.
17
    /// </summary>
18
    /// <param name="options">The options.</param>
19
    public SimpleInjectorStarter(SimpleInjectorOptions options)
4✔
20
    {
21
        _options = options;
4✔
22
    }
4✔
23

24
    /// <summary>
25
    /// Runs the application KickStart extension with specified <paramref name="context" />.
26
    /// </summary>
27
    /// <param name="context">The KickStart <see cref="T:KickStart.Context" /> containing assemblies to scan.</param>
28
    public void Run(Context context)
29
    {
30
        var container = _options?.Creator() ?? new Container();
4!
31

32
        // must run first to allow settings options
33
        _options?.Initializer?.Invoke(container);
4!
34

35
        RegisterSimpleInjector(context, container);
4✔
36
        RegisterServiceModule(context, container);
4✔
37

38
        if (_options.VerificationOption.HasValue)
4!
NEW
39
            container.Verify(_options.VerificationOption.Value);
×
40

41
        _options.Accessor?.Invoke(container);
4✔
42

43
        context.SetServiceProvider(container);
4✔
44
    }
4✔
45

46

47
    private void RegisterSimpleInjector(Context context, Container container)
48
    {
49
        var modules = context.GetInstancesAssignableFrom<ISimpleInjectorRegistration>();
4✔
50
        foreach (var module in modules)
16✔
51
        {
52
            context.WriteLog("Register SimpleInjector Module: {0}", module);
4✔
53

54
            module.Register(container, context.Data);
4✔
55
        }
56
    }
4✔
57

58
    private void RegisterServiceModule(Context context, Container container)
59
    {
60
        var wrapper = new SimpleInjectorRegistration(context, container);
4✔
61
        var modules = context.GetInstancesAssignableFrom<IServiceModule>();
4✔
62
        foreach (var module in modules)
12✔
63
        {
64
            context.WriteLog("Register Service Module: {0}", module);
2✔
65

66
            module.Register(wrapper, context.Data);
2✔
67
        }
68
    }
4✔
69
}
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