< Summary - erichiller/mkmrk.Channels coverage

Information
Class: mkmrk.Channels.ChannelWriteException
Assembly: mkmrk.Channels
File(s): /home/runner/work/mkmrk.Channels/mkmrk.Channels/src/mkmrk.Channels/Exceptions/ChannelWriteException.cs
Tag: 161_8859726157
Line coverage
0%
Covered lines: 0
Uncovered lines: 17
Coverable lines: 17
Total lines: 40
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 8
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
.ctor(...)100%10%
Throw(...)0%40%
Throw<TChannelWriter>(...)0%40%

File(s)

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

#LineLine coverage
 1using System.Collections;
 2using System.Diagnostics;
 3using System.Diagnostics.CodeAnalysis;
 4
 5namespace mkmrk.Channels;
 6
 7/// <summary>
 8/// Error occurred when writing to Channel
 9/// </summary>
 10[ SuppressMessage( "Design", "CA1032:Implement standard exception constructors" ) ]
 11public class ChannelWriteException : System.Exception {
 12    /// <inheritdoc cref="ChannelWriteException" />
 013    internal ChannelWriteException( string? message, System.Exception? innerException = null ) : base( message, innerExc
 14
 15    /// <inheritdoc cref="ChannelWriteException" />
 16    [ DoesNotReturn ]
 17    [ StackTraceHidden ]
 018    public static void Throw( string? message = null, IDictionary? data = null, System.Exception? innerException = null 
 019        var exception = new ChannelWriteException( message, innerException );
 020        if ( data is { } ) {
 021            foreach ( var key in data.Keys ) {
 022                exception.Data.Add( key, data[ key ] );
 023            }
 024        }
 025        throw exception;
 26    }
 27
 28    /// <inheritdoc cref="ChannelWriteException" />
 29    [ DoesNotReturn ]
 30    [ StackTraceHidden ]
 031    public static void Throw<TChannelWriter>( string operation, IDictionary? data = null, System.Exception? innerExcepti
 032        var exception = new ChannelWriteException( $"An error occurred when writing to {typeof(TChannelWriter).GenericTy
 033        if ( data is { } ) {
 034            foreach ( var key in data.Keys ) {
 035                exception.Data.Add( key, data[ key ] );
 036            }
 037        }
 038        throw exception;
 39    }
 40}