public void when_encode_empty_string_it_should_produce_zero_length_array()
        {
            var sut = new Utf8ByteStringHeaderValueCodec();

            var value = sut.Encode(string.Empty);

            value.Should().BeEquivalentTo(new byte[0]);
        }
        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");
        }
        public void when_encode_it_should_produce_original_byte_array()
        {
            const string expected = "Поезд едет 🚃";

            var sut = new Utf8ByteStringHeaderValueCodec();

            var value = sut.Encode(expected);

            value.Should().BeEquivalentTo(Encoding.UTF8.GetBytes(expected));
        }