public void CheckReadWriteInt64ReturnsSameValue(long value, ByteOrder byteOrder) { using (var baseStream = new MemoryStream()) { var constructWriter = new ConstructWriterStream(baseStream); constructWriter.WriteInt64(value, byteOrder); baseStream.Seek(0, SeekOrigin.Begin); var constructReader = new ConstructReaderStream(baseStream); var result = constructReader.ReadInt64(byteOrder); Assert.AreEqual(value, result); } }
public void NotEnoughDataIsThrownWhenNotEnoughData() { var constructStream = new ConstructReaderStream(DataStream.Create(123)); Assert.Throws<NotEnoughDataException>(() => constructStream.ReadInt64(ByteOrder.Host)); }
public void ReadLongIsCorrectValue(long value, ByteOrder byteOrder) { var constructStream = new ConstructReaderStream(DataStream.Create(value, byteOrder)); Assert.AreEqual(value, constructStream.ReadInt64(byteOrder)); }