public void TestCyclic() { var a = new CyclicA(); var b = new CyclicB(); a.B = b; b.A = a; Test(a); }
public override void Setup(BenchmarkContext context) { base.Setup(context); var a = new CyclicA(); var b = new CyclicB(); a.B = b; b.A = a; InitStreamWith(a); }
public override void Setup(BenchmarkContext context) { base.Setup(context); _testStruct = LargeStruct.Create(); _testObject = TypicalPersonData.MakeRandom(); var a = new CyclicA(); var b = new CyclicB(); a.B = b; b.A = a; _cyclic = a; }
//[Fact] public void should_throw_exception_with_cyclic_dependency() { var a = new CyclicA(); var b = new CyclicB(); a.References = b; b.References = a; var serializer = new JsonSerializer(_mappingRegistry); Assert.Throws <Exception>(() => { var output = serializer.Serialize(a); _testOutputHelper.WriteLine(output.AsString); }); }
public CyclicB(CyclicA a) { }
public CyclicB(CyclicA dependency) { this.dependency = dependency; }