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

Information
Class: ZhEaIsNsAaBn.DbSeeder.Design.DesignRow
Assembly: ZhEaIsNsAaBn.DbSeeder.Design
File(s): /home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.DbSeeder.Design/Files/DesignRow.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 16
Line coverage: 100%
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
.ctor(...)100%11100%
get_Item(...)100%11100%
Only(...)100%11100%

File(s)

/home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.DbSeeder.Design/Files/DesignRow.cs

#LineLine coverage
 1namespace ZhEaIsNsAaBn.DbSeeder.Design;
 2
 3/// One row as written to a file: property name → canonical JSON value, in model order; <see cref="Key"/> identifies it.
 21574internal sealed record DesignRow( string Key, IReadOnlyList<(string Name, string Json)> Values )
 5{
 6    /// The row's value of <paramref name="name"/>; <see langword="null"/> when it doesn't have the property.
 34267    public string? this[ string name ] => Values.FirstOrDefault( v => v.Name == name ).Json;
 8
 9    /// Only the given properties (e.g. the match key for a Delete row).
 10    public DesignRow Only( IEnumerable<string> names )
 11    {
 24012        var keep = names.ToHashSet( StringComparer.Ordinal );
 13
 24014        return this with { Values = Values.Where( v => keep.Contains( v.Name ) ).ToList() };
 15    }
 16}