public void ReadByte_ErrorWhileWaiting() { StreamTester tester = new StreamTester(_stream); tester.ScheduleChannelError(); tester.StartAfter(200); try { Assert.Catch <SCPClientInvalidStatusException>( () => _stream.ReadByte(1000) ); } finally { tester.WaitForCompletion(); } }
public void ReadByte_ErrorWhileWaiting() { StreamTester tester = new StreamTester(_stream); _stream.BufferOffset = 3; // offset=3, length=0 tester.ScheduleChannelError(); tester.StartAfter(200); try { _stream.ReadByte(1000); } finally { tester.WaitForCompletion(); tester.AssertBufferStatus(INITAL_BUFFER_SIZE, 3, 0); tester.AssertFinal(); } }
public void Read_ErrorWhileWaiting() { byte[] buff = new byte[100]; StreamTester tester = new StreamTester(_stream); _stream.BufferOffset = 3; // offset=3, length=0 tester.ScheduleChannelError(); tester.StartAfter(200); try { _stream.Read(buff, 1000); } finally { tester.WaitForCompletion(); tester.AssertBufferStatus(INITAL_BUFFER_SIZE, 3, 0); tester.AssertFinal(); } }
public void ReadUntil_ErrorWhileWaiting() { StreamTester tester = new StreamTester(_stream); _stream.BufferOffset = 3; // offset=3, length=0 tester.ScheduleData(6); tester.ScheduleChannelError(); tester.StartAfter(200); try { _stream.ReadUntil(10, 1000); } finally { tester.WaitForCompletion(); tester.AssertBufferStatus(INITAL_BUFFER_SIZE, 3, 6); tester.AssertBufferStatus(INITAL_BUFFER_SIZE, 3, 6); tester.AssertFinal(); } }