< 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: 57_24045730253
Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 31
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;
 2
 3namespace NLightning.Infrastructure.Repositories;
 4
 5using Domain.Bitcoin.Interfaces;
 6using Domain.Channels.Interfaces;
 7using Domain.Persistence.Interfaces;
 8using Memory;
 9
 10/// <summary>
 11/// Extension methods for setting up Persistence infrastructure services in an IServiceCollection.
 12/// </summary>
 13public static class DependencyInjection
 14{
 15    /// <summary>
 16    /// Adds Bitcoin infrastructure services to the specified IServiceCollection.
 17    /// </summary>
 18    /// <param name="services">The IServiceCollection to add services to.</param>
 19    /// <returns>The same service collection so that multiple calls can be chained.</returns>
 20    public static IServiceCollection AddRepositoriesInfrastructureServices(this IServiceCollection services)
 021    {
 22        // Register UnitOfWork
 023        services.AddScoped<IUnitOfWork, UnitOfWork>();
 24
 25        // Register memory repositories
 026        services.AddSingleton<IChannelMemoryRepository, ChannelMemoryRepository>();
 027        services.AddSingleton<IUtxoMemoryRepository, UtxoMemoryRepository>();
 28
 029        return services;
 030    }
 31}