public void GivenBytes_Parse_ReturnsEncoding() { Assert.NotNull(MessageEncoding.Parse("EUC-JP".ToByteValueAndSOH())); Assert.NotNull(MessageEncoding.Parse("ISO-2022-JP".ToByteValueAndSOH())); Assert.NotNull(MessageEncoding.Parse("UTF-8".ToByteValueAndSOH())); }
public void GivenInvalidBytes_Parse_ThrowsNotSupportedException() { Assert.Throws <NotSupportedException>(() => MessageEncoding.Parse((new byte[3]).AsSpan())); }