< Summary - pva.SuperV

Information
Class: pva.SuperV.Model.FieldFormatters.FieldFormatterMapper
Assembly: pva.SuperV.Model
File(s): /home/runner/work/pva.SuperV/pva.SuperV/pva.SuperV.Model/FieldFormatters/FieldFormatterMapper.cs
Tag: dotnet-ubuntu_18869653307
Line coverage
80%
Covered lines: 8
Uncovered lines: 2
Coverable lines: 10
Total lines: 23
Line coverage: 80%
Branch coverage
50%
Covered branches: 2
Total branches: 4
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ToDto(...)50%2280%
FromDto(...)50%2280%

File(s)

/home/runner/work/pva.SuperV/pva.SuperV/pva.SuperV.Model/FieldFormatters/FieldFormatterMapper.cs

#LineLine coverage
 1using pva.SuperV.Engine.Exceptions;
 2using pva.SuperV.Engine.FieldFormatters;
 3using pva.SuperV.Model.FieldDefinitions;
 4
 5namespace pva.SuperV.Model.FieldFormatters
 6{
 7    public static class FieldFormatterMapper
 8    {
 9        public static FieldFormatterModel ToDto(FieldFormatter fieldFormatter)
 11910            => fieldFormatter switch
 11911            {
 11912                EnumFormatter enumFormatter => new EnumFormatterModel(enumFormatter.Name!, enumFormatter.Values!),
 013                _ => throw new UnhandledMappingException(nameof(FieldDefinitionMapper), fieldFormatter.GetType().ToStrin
 11914            };
 15
 16        public static FieldFormatter FromDto(FieldFormatterModel fieldFormatterModel)
 417            => fieldFormatterModel switch
 418            {
 419                EnumFormatterModel enumFormatterModel => new EnumFormatter(enumFormatterModel.Name!, enumFormatterModel.
 020                _ => throw new UnhandledMappingException(nameof(FieldDefinitionMapper), fieldFormatterModel.GetType().To
 421            };
 22    }
 23}