< Summary

Information
Class: IceRpc.Ice.IceEncodeOptions
Assembly: IceRpc.Ice
File(s): /home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc.Ice/IceEncodeOptions.cs
Tag: 1321_24790053727
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 33
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 3
Fully covered methods: 3
Total methods: 3
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Default()100%11100%
get_PipeOptions()100%11100%
.ctor(...)100%11100%

File(s)

/home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc.Ice/IceEncodeOptions.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3using System.Buffers;
 4using System.IO.Pipelines;
 5
 6namespace IceRpc.Ice;
 7
 8/// <summary>Represents a property bag used to configure the encoding of payloads.</summary>
 9public sealed class IceEncodeOptions
 10{
 11    /// <summary>Gets the default instance of <see cref="IceEncodeOptions" />.</summary>
 13912    public static IceEncodeOptions Default { get; } = new();
 13
 14    /// <summary>Gets the pipe options that the IceRPC + Ice integration uses when creating pipes. The IceRPC + Ice
 15    /// integration creates a pipe when encoding a request or response payload, and when encoding an async enumerable
 16    /// into a <see cref="PipeReader" />.</summary>
 13717    public PipeOptions PipeOptions { get; }
 18
 19    /// <summary>Constructs a new instance.</summary>
 20    /// <param name="pool">The pool parameter for the constructor of <see cref="System.IO.Pipelines.PipeOptions" />.
 21    /// </param>
 22    /// <param name="minimumSegmentSize">The minimum segment size for the constructor of
 23    /// <see cref="System.IO.Pipelines.PipeOptions" />.</param>
 224    public IceEncodeOptions(MemoryPool<byte>? pool = default, int minimumSegmentSize = -1) =>
 25        // We keep the default readerScheduler (ThreadPool) because pipes created from these PipeOptions are never
 26        // ReadAsync concurrently with a FlushAsync/Complete on the pipe writer. The writerScheduler does not matter
 27        // since FlushAsync never blocks.
 228        PipeOptions = new(
 229            pool: pool,
 230            minimumSegmentSize: minimumSegmentSize,
 231            pauseWriterThreshold: 0,
 232            useSynchronizationContext: false);
 33}