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()); }
public void testTimeout_skip_Timeout() { beginRead(); try { _timeoutstream.skip(1024); Assert.Fail("incorrectly skipped bytes"); } catch (TimeoutException) { // expected } assertTimeout(); }