public void ImmediateCircularReferenceDetection() { var context = new ExportContext(); var exporter = new ComponentExporter(typeof(Thing)); context.Register(exporter); var thing = new Thing(); thing.Other = thing; exporter.Export(context, thing, new EmptyJsonWriter()); }
public void DeepCircularReferenceDetection() { ExportContext context = new ExportContext(); ComponentExporter exporter = new ComponentExporter(typeof(Thing)); context.Register(exporter); Thing thing = new Thing(); thing.Other = new Thing(); thing.Other.Other = new Thing(); thing.Other.Other.Other = thing; exporter.Export(context, thing, new EmptyJsonWriter()); }
public void CircularReferenceDetectionAcrossTypes() { ExportContext context = new ExportContext(); ComponentExporter exporter = new ComponentExporter(typeof(Parent)); context.Register(exporter); context.Register(new ComponentExporter(typeof(ParentChild))); Parent parent = new Parent(); parent.Child = new ParentChild(); parent.Child.Parent = parent; exporter.Export(context, parent, new EmptyJsonWriter()); }
public void Export(ExportContext context, JsonWriter writer) { var exporter = new ComponentExporter(typeof(Point), _componentType); exporter.Export(new ExportContext(), this, writer); }
public void Export(ExportContext context, JsonWriter writer) { ComponentExporter exporter = new ComponentExporter(typeof(Point), _componentType); exporter.Export(new ExportContext(), this, writer); }