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

Information
Line coverage
40%
Covered lines: 2
Uncovered lines: 3
Coverable lines: 5
Total lines: 30
Line coverage: 40%
Branch coverage
50%
Covered branches: 4
Total branches: 8
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%210%
.ctor(...)100%210%
.ctor(...)100%210%
.ctor(...)50%88100%

File(s)

/home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.DbSeeder/Errors/DbSeederException.cs

#LineLine coverage
 1namespace ZhEaIsNsAaBn.DbSeeder;
 2
 3/// <summary>
 4/// Thrown only by the EF seeding hook (<c>UseDbSeeder</c>): EF's <c>UseSeeding</c> callback can't return a result, and 
 5/// must fail <c>Migrate()</c>. Everywhere else DbSeeder returns <see cref="LayerResponse"/> errors.
 6/// </summary>
 7public sealed class DbSeederException : Exception
 8{
 9    /// <summary>Creates the exception with no errors.</summary>
 010    public DbSeederException() : this( "Seed migration failed." ) { }
 11
 12    /// <summary>Creates the exception with a message and no errors.</summary>
 13    /// <param name="message">The message.</param>
 014    public DbSeederException( string message ) : base( message ) => Errors = [];
 15
 16    /// <summary>Creates the exception with a message, an inner exception and no errors.</summary>
 17    /// <param name="message">The message.</param>
 18    /// <param name="innerException">The cause.</param>
 019    public DbSeederException( string message, Exception innerException ) : base( message, innerException ) => Errors = [
 20
 21    /// <summary>Creates the exception from the errors of a failed run.</summary>
 22    /// <param name="errors">The errors; the first one's exception becomes the inner exception.</param>
 23    public DbSeederException( IReadOnlyList<Error> errors )
 324        : base( $"Seed migration failed: {string.Join( ", ", ( errors ?? [] ).Select( e => e.Code ) )}.", errors?.FirstO
 325        => Errors = errors ?? [];
 26
 27
 28    /// <summary>The errors of the failed run.</summary>
 29    public IReadOnlyList<Error> Errors { get; }
 30}