< Summary

Information
Class: MyNet.UI.Loading.Models.ProgressionBusy
Assembly: MyNet.UI
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.UI/Loading/Models/ProgressionBusy.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 45
Line coverage: 100%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
set_Title(...)100%11100%
set_Value(...)100%11100%
Report(...)50%22100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.UI/Loading/Models/ProgressionBusy.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="ProgressionBusy.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System.Collections.ObjectModel;
 8
 9namespace MyNet.UI.Loading.Models;
 10
 11/// <summary>
 12/// Busy state for multi-step operations with progress value, current title, and message history.
 13/// </summary>
 14public class ProgressionBusy : Busy
 15{
 16    /// <summary>
 17    /// Gets or sets the title displayed for the busy operation.
 18    /// </summary>
 319    public string Title { get; set => SetProperty(ref field, value); } = string.Empty;
 20
 21    /// <summary>
 22    /// Gets or sets the progress value of the busy operation.
 23    /// </summary>
 924    public double Value { get; set => SetProperty(ref field, value); }
 25
 26    /// <summary>
 27    /// Gets the collection of messages history.
 28    /// </summary>
 29    public ObservableCollection<string> Messages { get; } = [];
 30
 31    /// <summary>
 32    /// Reports progress with optional message.
 33    /// </summary>
 34    public void Report(double value, string? message = null)
 35    {
 336        Value = value;
 37
 338        if (!string.IsNullOrWhiteSpace(message))
 39        {
 340            Title = message;
 341            Messages.Add(message);
 42        }
 343    }
 44}
 45