< Summary

Information
Class: Ice.OutgoingResponse
Assembly: Ice
File(s): /home/runner/work/ice/ice/csharp/src/Ice/OutgoingResponse.cs
Tag: 71_18251537082
Line coverage
94%
Covered lines: 16
Uncovered lines: 1
Coverable lines: 17
Total lines: 75
Line coverage: 94.1%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage
85%
Covered methods: 6
Total methods: 7
Method coverage: 85.7%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_exceptionId()100%11100%
get_exceptionDetails()100%210%
get_outputStream()100%11100%
get_replyStatus()100%11100%
get_size()50%22100%
.ctor(...)100%11100%
.ctor(...)100%11100%

File(s)

/home/runner/work/ice/ice/csharp/src/Ice/OutgoingResponse.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3#nullable enable
 4
 5using Ice.Internal;
 6
 7namespace Ice;
 8
 9/// <summary>
 10/// Represents the response to an incoming request. It's returned by <see cref="Object.dispatchAsync" />.
 11/// </summary>
 12public sealed class OutgoingResponse
 13{
 14    /// <summary>
 15    /// Gets the exception ID of the response.
 16    /// </summary>
 17    /// <value>The exception ID of the response. It's null when replyStatus is <see cref="ReplyStatus.Ok" /> or
 18    /// <see cref="ReplyStatus.UserException"/> . Otherwise, this ID is the value returned by
 19    /// <see cref="LocalException.ice_id()" />. For other exceptions, this ID is the full name of the exception's type.
 20    /// </value>
 121    public string? exceptionId { get; }
 22
 23    /// <summary>
 24    /// Gets the full details of the exception marshaled into the response.
 25    /// </summary>
 26    /// <value>The exception details, usually produced by calling <see cref="object.ToString" /> on the exception. It's
 27    /// null when replyStatus is <see cref="ReplyStatus.Ok" /> or <see cref="ReplyStatus.UserException"/>.</value>
 028    public string? exceptionDetails { get; }
 29
 30    /// <summary>
 31    /// Gets the output stream buffer of the response. This output stream should not be written to after construction.
 32    /// </summary>
 133    public OutputStream outputStream { get; }
 34
 35    /// <summary>
 36    /// Gets the reply status of the response.
 37    /// </summary>
 138    public ReplyStatus replyStatus { get; }
 39
 40    /// <summary>
 41    /// Gets the number of bytes in the response's payload.
 42    /// </summary>
 143    public int size => outputStream.isEmpty() ? 0 : outputStream.size() - Protocol.headerSize - 4;
 44
 45    /// <summary>
 46    /// Initializes a new instance of the <see cref="OutgoingResponse" /> class.
 47    /// </summary>
 48    /// <param name="replyStatus">The reply status.</param>
 49    /// <param name="exceptionId">The ID of the exception, when the response carries an exception other than a user
 50    /// exception.</param>
 51    /// <param name="exceptionDetails">The full details of the exception, when the response carries an exception other
 52    /// than a user exception.</param>
 53    /// <param name="outputStream">The output stream that holds the response.</param>
 154    public OutgoingResponse(
 155        ReplyStatus replyStatus,
 156        string? exceptionId,
 157        string? exceptionDetails,
 158        OutputStream outputStream)
 59    {
 160        this.replyStatus = replyStatus;
 161        this.exceptionId = exceptionId;
 162        this.exceptionDetails = exceptionDetails;
 163        this.outputStream = outputStream;
 164    }
 65
 66    /// <summary>
 67    /// Initializes a new instance of the <see cref="OutgoingResponse" /> class with the <see cref="ReplyStatus.Ok" />
 68    /// status.
 69    /// </summary>
 70    /// <param name="outputStream">The output stream that holds the response.</param>
 71    public OutgoingResponse(OutputStream outputStream)
 172        : this(ReplyStatus.Ok, exceptionId: null, exceptionDetails: null, outputStream)
 73    {
 174    }
 75}