public void WriteTest()
        {
            var encoding = new UnicodeEncoding();
            var ms       = new MemoryStream();

            var pipeStream = new NamedPipeStreamWriter(ms);

            pipeStream.Write(TestString);

            ms.Position = 2;

            byte[] buffer = new byte[172];

            ms.Read(buffer, 0, 172);

            string result = encoding.GetString(buffer);

            Assert.AreEqual(TestString, result);
        }
 public void Setup()
 {
     this.stream       = new MemoryStream();
     this.streamWriter = new NamedPipeStreamWriter(this.stream);
     this.streamReader = new NamedPipeStreamReader(this.stream, BufferSize);
 }