< Summary

Information
Class: MyNet.Utilities.Progress.ProgressReport<T>
Assembly: MyNet.Utilities
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Utilities/Progress/ProgressReport.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 45
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
.ctor(...)100%11100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Utilities/Progress/ProgressReport.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="ProgressReport.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System;
 8using System.Collections.Generic;
 9
 10namespace MyNet.Utilities.Progress;
 11
 12/// <summary>
 13/// Represents a snapshot of the current progress state reported to subscribers.
 14/// </summary>
 15/// <typeparam name="T">The type of progress messages.</typeparam>
 16public sealed record ProgressReport<T>
 17{
 18    /// <summary>
 19    /// Initializes a new instance of the <see cref="ProgressReport{T}"/> class.
 20    /// </summary>
 21    /// <param name="progress">Overall progress value between 0.0 and 1.0.</param>
 22    /// <param name="messages">Breadcrumb of active messages from root to innermost step.</param>
 23    /// <param name="cancelAction">Action to invoke in order to cancel the operation, or <see langword="null"/> if none 
 24    /// <param name="canCancel">Whether the current operation can be cancelled.</param>
 25    public ProgressReport(double progress, IReadOnlyList<T> messages, Action? cancelAction, bool canCancel)
 26    {
 12327        Progress = progress;
 12328        Messages = messages;
 12329        CancelAction = cancelAction;
 12330        CanCancel = canCancel;
 12331    }
 32
 33    /// <summary>Gets the overall progress value, between 0.0 (not started) and 1.0 (complete).</summary>
 34    public double Progress { get; }
 35
 36    /// <summary>Gets the ordered list of active messages from the root step down to the innermost step.</summary>
 37    public IReadOnlyList<T> Messages { get; }
 38
 39    /// <summary>Gets the action to invoke to cancel the running operation, or <see langword="null"/> if not provided.</
 40    public Action? CancelAction { get; }
 41
 42    /// <summary>Gets a value indicating whether every active step supports cancellation.</summary>
 43    public bool CanCancel { get; }
 44}
 45