Ejemplo n.º 1
0
        public void TestSendAndReceiveString_Dispose()
        {
            const string expectedString = "LEONARD BERNSTEIN!";

            using (var sink = new StreamPrimitiveSink(_stream))
            {
                sink.SendString(expectedString);
            }

            _stream.Flush();
            _stream.Seek(0, SeekOrigin.Begin);
            using var source = new StreamPrimitiveSource(_stream);
            var actualString = source.ReceiveString();

            Assert.Equal(expectedString, actualString);
        }
Ejemplo n.º 2
0
 public StreamSinkToSourceTests()
 {
     _primitiveSink   = new StreamPrimitiveSink(_stream);
     _primitiveSource = new StreamPrimitiveSource(_stream);
 }