< Summary

Information
Class: IceRpc.Transports.DuplexConnectionOptions
Assembly: IceRpc
File(s): /home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc/Transports/DuplexConnectionOptions.cs
Tag: 275_13775359185
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 26
Line coverage: 100%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage
100%
Covered methods: 4
Total methods: 4
Method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_MinSegmentSize()100%11100%
set_MinSegmentSize(...)50%22100%
get_Pool()100%11100%
.ctor()100%11100%

File(s)

/home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc/Transports/DuplexConnectionOptions.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3using System.Buffers;
 4
 5namespace IceRpc.Transports;
 6
 7/// <summary>A property bag used to configure a <see cref="IDuplexConnection" />.</summary>
 8public record class DuplexConnectionOptions
 9{
 10    /// <summary>Gets or sets the minimum size of the segment requested from the <see cref="Pool" />.</summary>
 11    /// <value>The minimum size in bytes of the segment requested from the <see cref="Pool" />. It cannot be less than
 12    /// <c>1</c> KB. Defaults to <c>4</c> KB.</value>
 13    public int MinSegmentSize
 14    {
 249315        get => _minSegmentSize;
 161316        set => _minSegmentSize = value >= 1024 ? value :
 161317            throw new ArgumentException($"The {nameof(MinSegmentSize)} argument cannot be less than 1KB.", nameof(value)
 18    }
 19
 20    /// <summary>Gets or sets the <see cref="MemoryPool{T}" /> object used for buffer management.</summary>
 21    /// <value>A pool of memory blocks used for buffer management. Defaults to <see cref="MemoryPool{T}.Shared"
 22    /// />.</value>
 676123    public MemoryPool<byte> Pool { get; set; } = MemoryPool<byte>.Shared;
 24
 265525    private int _minSegmentSize = 4096;
 26}