Пример #1
0
        public void ShouldDeserializeObjectWithoutTypeInfo()
        {
            const string json     = "{\"$type\":\"" + TestTargetTypeName + "\",\"Id\":\"HalliGalli\"}";
            var          expected = new SerializationTestTarget {
                Id = "HalliGalli"
            };

            JsonAssert.DeserializesTo(json, expected);
        }
Пример #2
0
 public void ShouldNotDeserializeNullProperties()
 {
     JsonAssert.DeserializesTo(
         "{\"$type\":\"" + TestTargetTypeName + "\",\"Id\":null}",
         new SerializationTestTarget());
 }
Пример #3
0
 public void ShouldIgnoreMissingPropertiesForDeserialization()
 {
     JsonAssert.DeserializesTo("{\"$type\":\"" + TestTargetTypeName + "\"}", new SerializationTestTarget());
 }
Пример #4
0
 public void ShouldDeserializeNull()
 {
     JsonAssert.DeserializesTo("null", (object)null);
 }