< Summary - Combined Code Coverage

Information
Class: NLightning.Infrastructure.Repositories.DependencyInjection
Assembly: NLightning.Infrastructure.Repositories
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Infrastructure.Repositories/DependencyInjection.cs
Tag: 36_15743069263
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 29
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
AddRepositoriesInfrastructureServices(...)100%210%
AddRepositoriesInfrastructureServices(...)100%210%

File(s)

/home/runner/work/nlightning/nlightning/src/NLightning.Infrastructure.Repositories/DependencyInjection.cs

#LineLine coverage
 1using Microsoft.Extensions.DependencyInjection;
 2using NLightning.Domain.Channels.Interfaces;
 3using NLightning.Infrastructure.Repositories.Memory;
 4
 5namespace NLightning.Infrastructure.Repositories;
 6
 7using Domain.Persistence.Interfaces;
 8
 9/// <summary>
 10/// Extension methods for setting up Persistence infrastructure services in an IServiceCollection.
 11/// </summary>
 12public static class DependencyInjection
 13{
 14    /// <summary>
 15    /// Adds Bitcoin infrastructure services to the specified IServiceCollection.
 16    /// </summary>
 17    /// <param name="services">The IServiceCollection to add services to.</param>
 18    /// <returns>The same service collection so that multiple calls can be chained.</returns>
 19    public static IServiceCollection AddRepositoriesInfrastructureServices(this IServiceCollection services)
 020    {
 21        // Register UnitOfWork
 022        services.AddScoped<IUnitOfWork, UnitOfWork>();
 23
 24        // Register memory repositories
 025        services.AddSingleton<IChannelMemoryRepository, ChannelMemoryRepository>();
 26
 027        return services;
 028    }
 29}