Beispiel #1
0
        public void WritingToMultiSegmentBuffer()
        {
            IBufferWriter <byte> bufferWriter = new TestBufferWriterMultiSegment();

            bufferWriter.Write(Encoding.UTF8.GetBytes("Hello"));
            bufferWriter.Write(Encoding.UTF8.GetBytes(" World!"));
            Assert.Equal("Hello World!", bufferWriter.ToString());
        }
Beispiel #2
0
        public void WritingToMultiSegmentBuffer()
        {
            var bufferWriter = new TestBufferWriterMultiSegment();

            bufferWriter.Write(Encoding.UTF8.GetBytes("Hello"));
            bufferWriter.Write(Encoding.UTF8.GetBytes(" World!"));
            Assert.Equal(12, bufferWriter.Comitted.Count);
            Assert.Equal("Hello World!", bufferWriter.ToString());
        }