예제 #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);
 }