Exemplo n.º 1
0
        public void TryDeserialize_FailTest(byte[] data, string expErr)
        {
            Witness          wit    = new Witness();
            FastStreamReader stream = new FastStreamReader(data);
            bool             b      = wit.TryDeserialize(stream, out string error);

            Assert.False(b);
            Assert.Equal(expErr, error);
        }
Exemplo n.º 2
0
        public void TryDeserializeTest(PushDataOp[] expected, byte[] data)
        {
            Witness          wit    = new Witness();
            FastStreamReader stream = new FastStreamReader(data);
            bool             b      = wit.TryDeserialize(stream, out string error);

            Assert.True(b, error);
            Assert.Null(error);
            Assert.Equal(expected ?? new PushDataOp[0], wit.Items);
        }