< Summary

Information
Class: Syki.Front.Configs.ServicesConfigs
Assembly: Front
File(s): /home/runner/work/syki/syki/Front/Configs/ServicesConfigs.cs
Tag: 22_11348620282
Line coverage
0%
Covered lines: 0
Uncovered lines: 15
Coverable lines: 15
Total lines: 29
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
AddServicesConfigs(...)100%210%
AddServiceConfigs(...)0%2040%

File(s)

/home/runner/work/syki/syki/Front/Configs/ServicesConfigs.cs

#LineLine coverage
 1namespace Syki.Front.Configs;
 2
 3public static class ServicesConfigs
 4{
 5    public static void AddServicesConfigs(this WebAssemblyHostBuilder builder)
 6    {
 07        builder.Services.AddServiceConfigs(typeof(IAcademicClient));
 08        builder.Services.AddServiceConfigs(typeof(IAdmClient));
 09        builder.Services.AddServiceConfigs(typeof(ICrossClient));
 010        builder.Services.AddServiceConfigs(typeof(IStudentClient));
 011        builder.Services.AddServiceConfigs(typeof(ITeacherClient));
 12
 013        builder.Services.AddScoped<ClipboardService>();
 014    }
 15
 16    private static void AddServiceConfigs(this IServiceCollection services, Type? marker)
 17    {
 018        var types = AppDomain.CurrentDomain.GetAssemblies()
 019            .Where(s => s.FullName.StartsWith("Front"))
 020            .SelectMany(s => s.GetTypes())
 021            .Where(p => marker.IsAssignableFrom(p) && !p.IsInterface)
 022            .ToList();
 23
 024        foreach (var type in types)
 25        {
 026            services.AddScoped(type);
 27        }
 028    }
 29}