public void TryRead_Fail_NullStreamTest() { bool b = LockTime.TryRead(null, out LockTime actual, out string error); Assert.False(b); Assert.Equal("Stream can not be null.", error); Helper.ComparePrivateField(actual, "value", 0U); }
public void TryReadTest(byte[] data, uint expected) { FastStreamReader stream = new FastStreamReader(data); bool b = LockTime.TryRead(stream, out LockTime actual, out string error); Assert.True(b); Assert.Null(error); Helper.ComparePrivateField(stream, "position", 4); Helper.ComparePrivateField(actual, "value", expected); }
public void TryRead_Fail_SmallStreamTest() { FastStreamReader stream = new FastStreamReader(new byte[3] { 1, 2, 3 }); bool b = LockTime.TryRead(stream, out LockTime actual, out string error); Assert.False(b); Assert.Equal(Err.EndOfStream, error); Helper.ComparePrivateField(actual, "value", 0U); }