Ejemplo n.º 1
0
        public void WritingEmptyBufferToMultipleSegmentEmptyBufferWriterDoesNothing()
        {
            IBufferWriter <byte> bufferWriter = new MultiSegmentArrayBufferWriter <byte>(
                new byte[][] { Array.Empty <byte>(), Array.Empty <byte>() }
                );

            bufferWriter.Write(Array.Empty <byte>());
        }
Ejemplo n.º 2
0
        public void WritingToTooSmallSingleSegmentBufferFailsWithException(int inputSize, int destinationSize)
        {
            IBufferWriter <byte> bufferWriter = new MultiSegmentArrayBufferWriter <byte>(
                new byte[][] { new byte[destinationSize] }
                );

            Assert.Throws <ArgumentOutOfRangeException>(paramName: "writer", testCode: () => bufferWriter.Write(new byte[inputSize]));
        }
Ejemplo n.º 3
0
        public void WritingEmptyBufferToSingleSegmentEmptyBufferWriterDoesNothing()
        {
            IBufferWriter <byte> bufferWriter = new MultiSegmentArrayBufferWriter <byte>(
                new byte[][] { Array.Empty <byte>() }
                );

            bufferWriter.Write(Array.Empty <byte>()); // This is equivalent to: Span<byte>.Empty.CopyTo(Span<byte>.Empty);
        }