public void OnlyHandlesBackReferencesForClassesAndInterfaces() { serializer.EnableAutomaticBackReferences(); var original = new RootWithPrimitive { Child = new RootWithPrimitive.ChildWithPrimitive { Int = 2, DateTime = DateTime.Now } }; Should.NotThrow(() => JObject.FromObject(original, CreateSerializer()).ToObject <RootWithPrimitive>(CreateSerializer())); }
public void OnlyHandlesBackReferencesForClassesAndInterfaces() { serializer.EnableAutomaticBackReferences(); var original = new RootWithPrimitive { Child = new RootWithPrimitive.ChildWithPrimitive { Int = 2, DateTime = DateTime.Now } }; Should.NotThrow(() => JObject.FromObject(original, CreateSerializer()).ToObject<RootWithPrimitive>(CreateSerializer())); }