public void CannotOverwriteData()
        {
            ThreadPool.QueueUserWorkItem(state =>
            {
                syncEvent1.WaitOne();

                buffer.Write(Encoding.ASCII.GetBytes("Sample Data 2"));

                syncEvent2.Set();
            });

            buffer.Write(Encoding.ASCII.GetBytes("Sample Data 1"));

            syncEvent1.Set();

            Assert.False(syncEvent2.WaitOne(TimeSpan.FromMilliseconds(100)));
            Assert.Contains("Sample Data 1", Encoding.ASCII.GetString(buffer.Read()));

            syncEvent2.WaitOne();
        }
        public void CannotReadFromDisposedObject()
        {
            buffer.Dispose();

            Assert.Throws <ObjectDisposedException>(() => buffer.Read());
        }