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); }
public void Should_return_null_When_passing_empty_payload() => UnitUnderTest.Decode(new byte[0], typeof(EncodingTestItem)).Should().BeNull();