示例#1
0
        public void Should_be_able_to_Encode_and_Decode_an_instance()
        {
            var testItem = EncodingTestItem.Create();

            var encoded = UnitUnderTest.Encode(testItem);

            encoded.Should().NotBeNullOrEmpty();

            var decoded = UnitUnderTest.Decode(encoded.GetBytes().ToArray(), testItem.GetType());

            decoded.Should().BeEquivalentTo(testItem);
        }
示例#2
0
 public void Should_return_null_When_passing_empty_payload()
 => UnitUnderTest.Decode(new byte[0], typeof(EncodingTestItem)).Should().BeNull();