< Summary - erichiller/mkmrk.Channels coverage

Information
Class: mkmrk.Channels.ChannelNotClosedException
Assembly: mkmrk.Channels
File(s): /home/runner/work/mkmrk.Channels/mkmrk.Channels/src/mkmrk.Channels/Exceptions/ChannelNotClosedException.cs
Tag: 161_8859726157
Line coverage
29%
Covered lines: 5
Uncovered lines: 12
Coverable lines: 17
Total lines: 42
Line coverage: 29.4%
Branch coverage
12%
Covered branches: 1
Total branches: 8
Branch coverage: 12.5%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
.ctor(...)100%1100%
Throw(...)0%40%
Throw<TReturn>(...)25%450%

File(s)

/home/runner/work/mkmrk.Channels/mkmrk.Channels/src/mkmrk.Channels/Exceptions/ChannelNotClosedException.cs

#LineLine coverage
 1using System;
 2using System.Collections;
 3using System.Diagnostics;
 4using System.Diagnostics.CodeAnalysis;
 5using System.Threading.Channels;
 6
 7namespace mkmrk.Channels;
 8
 9/// <summary>
 10/// <see cref="Channel"/> is not closed, mutate actions not available.
 11/// </summary>
 12[ SuppressMessage( "Design", "CA1032:Implement standard exception constructors" ) ]
 13public sealed class ChannelNotClosedException : Exception {
 14    /// <inheritdoc cref="ChannelNotClosedException" />
 215    private ChannelNotClosedException( Exception? innerException ) : base( "Channel is not closed, mutate actions not av
 16
 17    /// <inheritdoc cref="ChannelNotClosedException" />
 18    [ DoesNotReturn ]
 19    [ StackTraceHidden ]
 020    public static void Throw( Exception? innerException = null, IDictionary? data = null ) {
 021        var exception = new ChannelNotClosedException( innerException );
 022        if ( data is { } ) {
 023            foreach ( var key in data.Keys ) {
 024                exception.Data.Add( key, data[ key ] );
 025            }
 026        }
 027        throw exception;
 28    }
 29
 30    /// <inheritdoc cref="ChannelNotClosedException" />
 31    [ DoesNotReturn ]
 32    [ StackTraceHidden ]
 233    public static TReturn Throw<TReturn>( Exception? innerException = null, IDictionary? data = null ) {
 234        var exception = new ChannelNotClosedException( innerException );
 235        if ( data is { } ) {
 036            foreach ( var key in data.Keys ) {
 037                exception.Data.Add( key, data[ key ] );
 038            }
 039        }
 240        throw exception;
 41    }
 42}