public void EmptyStringIsDeserializedIntoNullValue() { NullableEnumConverter <HttpStatusCode> converter = new NullableEnumConverter <HttpStatusCode>(); string text = ""; HttpStatusCode?code = converter.Deserialize(text.AsMemory(), CultureInfo.InvariantCulture, null); code.Should().BeNull(); }
public void NullableEnumDeserializerIsValid() { NullableEnumConverter <HttpStatusCode> converter = new NullableEnumConverter <HttpStatusCode>(); string text = "NotFound"; HttpStatusCode?code = converter.Deserialize(text.AsMemory(), CultureInfo.InvariantCulture, null); code.Should().Be(HttpStatusCode.NotFound); }