override public void Run() { BufferChunk bc = new BufferChunk(4); bc += (short)1; bc += (short)2; short ret = bc.NextInt16(); if(bc.Length != 2) { throw new TestCaseException("unexpected index"); } }
override public void Run() { BufferChunk bc = new BufferChunk(2); bc += (short)1; if(bc.NextInt16() != (short)1) { throw new TestCaseException("bytes don't match"); } }
override public void Run() { BufferChunk bc = new BufferChunk(new byte[1]); try { bc.NextInt16(); throw new TestCaseException("not enough data"); } catch(BufferChunk.InsufficientDataException) { if(bc.Length != 1) { throw new TestCaseException("lost data"); } } }
override public void Run() { BufferChunk bc = new BufferChunk(new byte[3]); bc.NextInt16(); }
override public void Run() { BufferChunk bc = new BufferChunk(2); try { bc.NextInt16(); throw new TestCaseException("no data"); } catch(BufferChunk.NoDataException){} }