Пример #1
0
        public void testTimeout_skip_Success()
        {
            var s = new MemoryStream();
            var t = new TimeoutStream(s);

            byte[] exp = new byte[] { (byte)'a', (byte)'b', (byte)'c' };
            s.Write(exp, 0, exp.Length);
            s.Seek(0, SeekOrigin.Begin);
            Assert.AreEqual(2, t.skip(2));
            Assert.AreEqual((byte)'c', t.ReadByte());
        }
Пример #2
0
 public void testTimeout_skip_Timeout()
 {
     beginRead();
     try
     {
         _timeoutstream.skip(1024);
         Assert.Fail("incorrectly skipped bytes");
     }
     catch (TimeoutException)
     {
         // expected
     }
     assertTimeout();
 }