public void when_decode_zero_length_byte_array_it_should_return_empty_string() { var sut = new Utf8ByteStringHeaderValueCodec(); var value = sut.Decode(new byte[0]); value.Should().BeEmpty($"it is the contract of {nameof(IHeaderValueCodec)}"); }
public void when_decode_null_value_it_should_return_empty_string() { var sut = new Utf8ByteStringHeaderValueCodec(); var value = sut.Decode(value: null); value.Should().BeEmpty($"it is the contract of {nameof(IHeaderValueCodec)}"); }
public void when_decode_it_should_produce_original_string() { const string expectedValue = "Поезд едет 🚃"; var sut = new Utf8ByteStringHeaderValueCodec(); var value = sut.Decode(Encoding.UTF8.GetBytes(expectedValue)); value.Should().Be(expectedValue, "value was encoded as UTF-8"); }