< Summary

Information
Class: SwiftCollections.Diagnostics.DiagnosticEvent
Assembly: SwiftCollections
File(s): /home/runner/work/SwiftCollections/SwiftCollections/src/SwiftCollections/Utility/Diagnostics/DiagnosticEvent.cs
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 46
Line coverage: 100%
Branch coverage
100%
Covered branches: 6
Total branches: 6
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%66100%
get_Channel()100%11100%
get_Level()100%11100%
get_Message()100%11100%
get_Source()100%11100%

File(s)

/home/runner/work/SwiftCollections/SwiftCollections/src/SwiftCollections/Utility/Diagnostics/DiagnosticEvent.cs

#LineLine coverage
 1namespace SwiftCollections.Diagnostics;
 2
 3/// <summary>
 4/// Represents a single diagnostic event emitted by a <see cref="DiagnosticChannel"/>.
 5/// </summary>
 6public readonly struct DiagnosticEvent
 7{
 8    /// <summary>
 9    /// Initializes a new instance of the <see cref="DiagnosticEvent"/> struct.
 10    /// </summary>
 11    /// <param name="channel">The channel that emitted the event.</param>
 12    /// <param name="level">The severity level of the event.</param>
 13    /// <param name="message">The event message.</param>
 14    /// <param name="source">An optional source identifier.</param>
 15    public DiagnosticEvent(
 16        string channel,
 17        DiagnosticLevel level,
 18        string message,
 19        string source = "")
 320    {
 321        Channel = channel ?? string.Empty;
 322        Level = level;
 323        Message = message ?? string.Empty;
 324        Source = source ?? string.Empty;
 325    }
 26
 27    /// <summary>
 28    /// Gets the channel that emitted the event.
 29    /// </summary>
 230    public string Channel { get; }
 31
 32    /// <summary>
 33    /// Gets the severity level of the event.
 34    /// </summary>
 235    public DiagnosticLevel Level { get; }
 36
 37    /// <summary>
 38    /// Gets the diagnostic message.
 39    /// </summary>
 240    public string Message { get; }
 41
 42    /// <summary>
 43    /// Gets the optional source identifier.
 44    /// </summary>
 245    public string Source { get; }
 46}