< Summary - ZhEaIsNsAaBn.Libraries coverage (affected: 23 packages)

Information
Class: ZhEaIsNsAaBn.Infrastructure.SqlServer.SqlServerInfrastructureOptionsExtension
Assembly: ZhEaIsNsAaBn.Infrastructure.SqlServer
File(s): /home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.Infrastructure.SqlServer/SqlServerInfrastructureOptionsExtension.cs
Line coverage
92%
Covered lines: 13
Uncovered lines: 1
Coverable lines: 14
Total lines: 45
Line coverage: 92.8%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Info()100%22100%
ApplyServices(...)100%11100%
Validate(...)100%11100%
.ctor(...)100%11100%
get_IsDatabaseProvider()100%11100%
get_LogFragment()100%210%
GetServiceProviderHashCode()100%11100%
ShouldUseSameServiceProvider(...)100%11100%
PopulateDebugInfo(...)100%11100%

File(s)

/home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.Infrastructure.SqlServer/SqlServerInfrastructureOptionsExtension.cs

#LineLine coverage
 1using Microsoft.EntityFrameworkCore.Infrastructure;
 2using Microsoft.Extensions.DependencyInjection;
 3
 4namespace ZhEaIsNsAaBn.Infrastructure.SqlServer;
 5
 6/// <summary>
 7/// Adds the SQL Server handlers (<see cref="IDbErrorClassifier"/>, <see cref="IStoredProcedureExecutor"/>,
 8/// <see cref="IModelDefaultsProvider"/>) to one context's internal service provider. Contexts without it get none.
 9/// </summary>
 10internal sealed class SqlServerInfrastructureOptionsExtension : IDbContextOptionsExtension
 11{
 12    private DbContextOptionsExtensionInfo? _info;
 13
 14
 307415    public DbContextOptionsExtensionInfo Info => _info ??= new ExtensionInfo( this );
 16
 17
 18    public void ApplyServices( IServiceCollection services )
 19    {
 2720        services.AddSingleton<IDbErrorClassifier>( SqlServerDbErrorClassifier.Instance );
 2721        services.AddSingleton<IStoredProcedureExecutor, SqlServerStoredProcedureExecutor>();
 2722        services.AddSingleton<IModelDefaultsProvider, SqlServerModelDefaults>();
 2723    }
 24
 2725    public void Validate( IDbContextOptions options ) { }
 26
 27
 26228    private sealed class ExtensionInfo( IDbContextOptionsExtension extension ) : DbContextOptionsExtensionInfo( extensio
 29    {
 2730        public override bool IsDatabaseProvider => false;
 31
 032        public override string LogFragment => "using ZhEaIsNsAaBn SQL Server infrastructure ";
 33
 113634        public override int GetServiceProviderHashCode() => 0;
 35
 94236        public override bool ShouldUseSameServiceProvider( DbContextOptionsExtensionInfo other ) => other is ExtensionIn
 37
 38        public override void PopulateDebugInfo( IDictionary<string, string> debugInfo )
 39        {
 2740            ArgumentNullException.ThrowIfNull( debugInfo );
 41
 2742            debugInfo[ "ZhEaIsNsAaBn:SqlServerInfrastructure" ] = "1";
 2743        }
 44    }
 45}