< Summary

Information
Class: UIBlazor.Components.CheckBox
Assembly: UIBlazor
File(s): /home/runner/work/InvAit/InvAit/UIBlazor/Components/CheckBox.razor
Tag: 14_22728831704
Line coverage
66%
Covered lines: 6
Uncovered lines: 3
Coverable lines: 9
Total lines: 29
Line coverage: 66.6%
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_Text()100%11100%
get_Value()100%11100%
get_ValueChanged()100%210%
get_Disabled()100%11100%
get_Style()100%11100%
get_AdditionalAttributes()100%11100%
.ctor()100%11100%
OnInternalValueChanged()100%210%

File(s)

/home/runner/work/InvAit/InvAit/UIBlazor/Components/CheckBox.razor

#LineLine coverage
 1<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center" Style="@Style" class="chec
 2    <RadzenCheckBox Value="@Value"
 3                    TValue="bool"
 4                    Change="@OnInternalValueChanged"
 5                    Name="@ComponentId"
 6                    Disabled="@Disabled"
 7                    @attributes="AdditionalAttributes" />
 8    <RadzenLabel Text="@Text" Component="@ComponentId" Style="flex: 1; cursor: pointer;" />
 9</RadzenStack>
 10
 11@code {
 512    [Parameter] public string Text { get; set; } = string.Empty;
 313    [Parameter] public bool Value { get; set; }
 014    [Parameter] public EventCallback<bool> ValueChanged { get; set; }
 315    [Parameter] public bool Disabled { get; set; }
 216    [Parameter] public string? Style { get; set; }
 17
 18    // Позволяет передавать любые другие атрибуты RadzenSwitch (напр. Title, TabIndex)
 19    [Parameter(CaptureUnmatchedValues = true)]
 220    public Dictionary<string, object>? AdditionalAttributes { get; set; }
 21
 222    private string ComponentId = $"switch_{Guid.NewGuid()}";
 23
 24    private async Task OnInternalValueChanged(bool newValue)
 25    {
 26        // Уведомляем родителя об изменении
 027        await ValueChanged.InvokeAsync(newValue);
 028    }
 29}