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

Information
Class: ZhEaIsNsAaBn.Utilities.ValidationResponses.BulkValidationResponse<T>
Assembly: ZhEaIsNsAaBn.Utilities.ValidationResponses
File(s): /home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/UtilitiesPackages/ZhEaIsNsAaBn.Utilities.ValidationResponses/BulkValidationResponse.cs
Line coverage
42%
Covered lines: 6
Uncovered lines: 8
Coverable lines: 14
Total lines: 55
Line coverage: 42.8%
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_IsValid()100%11100%
op_Implicit(...)100%210%
op_Implicit(...)100%210%
op_Implicit(...)100%11100%

File(s)

/home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/UtilitiesPackages/ZhEaIsNsAaBn.Utilities.ValidationResponses/BulkValidationResponse.cs

#LineLine coverage
 1namespace ZhEaIsNsAaBn.Utilities.ValidationResponses;
 2
 3/// <summary>
 4///     Represents a bulk validation response that contains multiple validation results.
 5///     Provides convenient implicit conversion operators for creating instances from various input types.
 6/// </summary>
 7/// <typeparam name="T">The type of data being validated.</typeparam>
 8public class BulkValidationResponse< T >
 9{
 10    /// <summary>
 11    ///     Gets or sets the list of validation responses for individual rows or items.
 12    /// </summary>
 13    /// <value>A list of <see cref="ValidationResponse{T}" /> objects representing validation results for each item.</va
 614    public List<ValidationResponse<T>> Rows { get; set; } = new();
 15
 16    /// <summary>
 17    ///     Gets a value indicating whether all validation responses in the collection are valid.
 18    /// </summary>
 19    /// <value><c>true</c> if all items in <see cref="Rows" /> are valid; otherwise, <c>false</c>.</value>
 620    public bool IsValid => Rows.TrueForAll( x => x.IsValid );
 21
 22    /// <summary>
 23    ///     Implicitly converts a single value to a <see cref="BulkValidationResponse{T}" /> containing that value.
 24    /// </summary>
 25    /// <param name="value">The value to convert.</param>
 26    /// <returns>A new <see cref="BulkValidationResponse{T}" /> instance containing the specified value.</returns>
 27    public static implicit operator BulkValidationResponse<T>( T value ) =>
 028        new()
 029            {
 030                Rows = [value]
 031            };
 32
 33    /// <summary>
 34    ///     Implicitly converts a single <see cref="ValidationResponse{T}" /> to a <see cref="BulkValidationResponse{T}"
 35    /// </summary>
 36    /// <param name="validation">The validation response to convert.</param>
 37    /// <returns>A new <see cref="BulkValidationResponse{T}" /> instance containing the specified validation response.</
 38    public static implicit operator BulkValidationResponse<T>( ValidationResponse<T> validation ) =>
 039        new()
 040            {
 041                Rows = [validation]
 042            };
 43
 44    /// <summary>
 45    ///     Implicitly converts a list of <see cref="ValidationResponse{T}" /> objects to a
 46    ///     <see cref="BulkValidationResponse{T}" />.
 47    /// </summary>
 48    /// <param name="validation">The list of validation responses to convert.</param>
 49    /// <returns>A new <see cref="BulkValidationResponse{T}" /> instance containing the specified validation responses.<
 50    public static implicit operator BulkValidationResponse<T>( List<ValidationResponse<T>> validation ) =>
 651        new()
 652            {
 653                Rows = validation
 654            };
 55}