< Summary

Information
Class: Nabs.Ui.Abstractions.BlazorUiMappings
Assembly: Nabs.Ui.Abstractions
File(s): /home/runner/work/Nabs/Nabs/src/Nabs.Ui.Abstractions/BlazorUiMappings.cs
Tag: 90_14636759620
Line coverage
76%
Covered lines: 10
Uncovered lines: 3
Coverable lines: 13
Total lines: 36
Line coverage: 76.9%
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
ClearMappings()100%11100%
AddFormGroupWrapper(...)100%11100%
AddFormInputWrapper(...)100%11100%
AddFormInputMapping(...)100%210%
AddFormInputMapping(...)100%11100%

File(s)

/home/runner/work/Nabs/Nabs/src/Nabs.Ui.Abstractions/BlazorUiMappings.cs

#LineLine coverage
 1namespace Nabs.Ui.Abstractions;
 2
 3public class BlazorUiMappings
 4{
 5    public Type? FormGroupWrapper { get; private set; }
 6    public Type? FormInputWrapper { get; private set; }
 7    public Dictionary<string, Type> InputMappings { get; } = [];
 8
 9    public void ClearMappings()
 10    {
 111        FormGroupWrapper = null;
 112        FormInputWrapper = null;
 113        InputMappings.Clear();
 114    }
 15
 16    public void AddFormGroupWrapper(Type componentType)
 17    {
 118        FormGroupWrapper = componentType;
 119    }
 20
 21    public void AddFormInputWrapper(Type componentType)
 22    {
 123        FormInputWrapper = componentType;
 124    }
 25
 26    public void AddFormInputMapping<TValue>(Type componentType)
 27    {
 028        var typeName = typeof(TValue).Name;
 029        InputMappings.TryAdd(typeName, componentType);
 030    }
 31
 32    public void AddFormInputMapping(string typeName, Type componentType)
 33    {
 134        InputMappings.TryAdd(typeName, componentType);
 135    }
 36}