< Summary

Information
Class: ErrorDetail
Assembly: Dom.Mediator
File(s): /home/runner/work/dom.mediator/dom.mediator/Dom.Mediator/Models/Error.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 1
Coverable lines: 1
Total lines: 27
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
get_field()100%210%

File(s)

/home/runner/work/dom.mediator/dom.mediator/Dom.Mediator/Models/Error.cs

#LineLine coverage
 01public record ErrorDetail(string field, string message);
 2
 3public class Error
 4{
 5    public string Code { get; init; } = string.Empty;
 6    public string Description { get; init; } = string.Empty;
 7
 8    public List<ErrorDetail> Details { get; } = new List<ErrorDetail>();
 9    public string Type { get; init; }
 10
 11    public Error(string code, string description, string type)
 12    {
 13        Code = code;
 14        Description = description;
 15        Type = type;
 16    }
 17
 18    public void AddDetail(string errorCode, string errorMessage)
 19    {
 20        Details.Add(new ErrorDetail(errorCode, errorMessage));
 21    }
 22
 23    public void AddDetails(List<ErrorDetail> validation)
 24    {
 25        Details.AddRange(validation);
 26    }
 27}

Methods/Properties

get_field()