public void TryDeserialize_FailTest(FastStreamReader stream, MockDeserializableTx tx, string expErr) { TxPayload pl = new TxPayload() { Tx = tx }; bool b = pl.TryDeserialize(stream, out string error); Assert.False(b); Assert.Equal(expErr, error); // Mock tx has its own tests. }
public void TryDeserializeTest() { TxPayload pl = new TxPayload() { Tx = new MockDeserializableTx(0, 3) }; FastStreamReader stream = new FastStreamReader(new byte[3]); bool b = pl.TryDeserialize(stream, out string error); Assert.True(b, error); Assert.Null(error); // Mock tx has its own tests. Assert.Equal(PayloadType.Tx, pl.PayloadType); }