예제 #1
0
 public void SetLengthLonger()
 {
     using (RebasedStream stream = CreateRebasedStream(4))
     {
         stream.SetLength(15);
         Assert.AreEqual(15, stream.Length);
         Assert.AreEqual(19, m_stream.Length);
     }
 }
예제 #2
0
 public void SetLengthShorter()
 {
     using (RebasedStream stream = CreateRebasedStream(4))
     {
         stream.SetLength(5);
         Assert.AreEqual(5, stream.Length);
         Assert.AreEqual(9, m_stream.Length);
     }
 }
예제 #3
0
 public void SetLengthLonger()
 {
     using (RebasedStream stream = CreateRebasedStream(4))
     {
         stream.SetLength(15);
         Assert.That(stream.Length, Is.EqualTo(15));
         Assert.That(m_stream.Length, Is.EqualTo(19));
     }
 }
예제 #4
0
 public void Dispose()
 {
     using (RebasedStream stream = CreateRebasedStream(3))
     {
         stream.Dispose();
         Assert.Throws <ObjectDisposedException>(() => { long p = stream.Position; });
         Assert.Throws <ObjectDisposedException>(() => stream.Position = 3);
         Assert.Throws <ObjectDisposedException>(() => { long p = stream.Length; });
         Assert.Throws <ObjectDisposedException>(() => stream.SetLength(20));
         Assert.Throws <ObjectDisposedException>(() => stream.Seek(0, SeekOrigin.Begin));
     }
 }