Exemplo n.º 1
0
        public void TestSetLengthNotSupported()
        {
            MemoryStream ms = new MemoryStream(SequencedBytes(20));

            using (Stream s = new ClampedStream(ms, 2, 10))
            {
                s.SetLength(20);
                Assert.Fail();
            }
        }
Exemplo n.º 2
0
        public void TestSetLength()
        {
            MemoryStream ms = new MemoryStream();

            using (Stream s = new ClampedStream(ms, 2, long.MaxValue))
            {
                s.SetLength(20);
                Assert.AreEqual(22, ms.Length);
            }
        }