< Summary

Information
Class: Pomodoro.Web.Components.History.StatCardBase
Assembly: Pomodoro.Web
File(s): /home/runner/work/Pomodoro/Pomodoro/src/Pomodoro.Web/Components/History/StatCard.razor.cs
Line coverage
100%
Covered lines: 16
Uncovered lines: 0
Coverable lines: 16
Total lines: 63
Line coverage: 100%
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_Formatter()100%11100%
get_Icon()100%11100%
get_Value()100%11100%
get_Label()100%11100%
GetFormattedValue()100%11100%
GetFormattedLabel()100%11100%
GetFormattedIcon()100%11100%
HasRequiredData()100%11100%

File(s)

/home/runner/work/Pomodoro/Pomodoro/src/Pomodoro.Web/Components/History/StatCard.razor.cs

#LineLine coverage
 1using Microsoft.AspNetCore.Components;
 2using Pomodoro.Web.Services.Formatters;
 3
 4namespace Pomodoro.Web.Components.History;
 5
 6/// <summary>
 7/// Code-behind for StatCard component
 8/// Displays a single statistic with icon, value and label
 9/// </summary>
 10public class StatCardBase : ComponentBase
 11{
 12    [Inject]
 15413    private StatCardFormatter Formatter { get; set; } = null!;
 14
 15    #region Parameters
 16
 17    [Parameter]
 21418    public string Icon { get; set; } = string.Empty;
 19
 20    [Parameter]
 21421    public string Value { get; set; } = string.Empty;
 22
 23    [Parameter]
 21324    public string Label { get; set; } = string.Empty;
 25
 26    #endregion
 27
 28    #region Methods for Testing
 29
 30    /// <summary>
 31    /// Gets the formatted display value
 32    /// </summary>
 33    public string GetFormattedValue()
 234    {
 235        return Formatter.GetFormattedValue(Value);
 236    }
 37
 38    /// <summary>
 39    /// Gets the formatted display label
 40    /// </summary>
 41    public string GetFormattedLabel()
 242    {
 243        return Formatter.GetFormattedLabel(Label);
 244    }
 45
 46    /// <summary>
 47    /// Gets the formatted display icon
 48    /// </summary>
 49    public string GetFormattedIcon()
 250    {
 251        return Formatter.GetFormattedIcon(Icon);
 252    }
 53
 54    /// <summary>
 55    /// Checks if the card has all required data
 56    /// </summary>
 57    public bool HasRequiredData()
 258    {
 259        return Formatter.HasRequiredData(Icon, Value, Label);
 260    }
 61
 62    #endregion
 63}