예제 #1
0
        public void EmptyStringIsDeserializedIntoNullValue()
        {
            NullableEnumConverter <HttpStatusCode> converter = new NullableEnumConverter <HttpStatusCode>();
            string         text = "";
            HttpStatusCode?code = converter.Deserialize(text.AsMemory(), CultureInfo.InvariantCulture, null);

            code.Should().BeNull();
        }
예제 #2
0
        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);
        }