Exemplo n.º 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();
        }
Exemplo n.º 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);
        }