public void ReadStress1Compare() { var types = ReadSchema("stress_tests/stress1.capnp").Objects.ToList(); Assert.Greater(types.Count, 0); var structs = types.Where(t => t is EsiStruct).Select(t => t as EsiStruct); Assert.Greater(structs.Count(), 0); var poly = structs.Where(t => t.Name == "Polynomial3").First(); Assert.True(Polynomal3Model.StructuralEquals(poly)); var ex = structs.Where(t => t.Name == "Example").First(); Assert.True(ExampleModel.StructuralEquals(ex)); }
public void ReadStress1Incorrect() { var types = ReadSchema("stress_tests/stress1.capnp").Objects.ToList(); Assert.Greater(types.Count, 0); var structs = types.Where(t => t is EsiStruct).Select(t => t as EsiStruct); Assert.Greater(structs.Count(), 0); var poly = structs.Where(t => t.Name == "Polynomial3").First(); var ex = structs.Where(t => t.Name == "Example").First(); // Test the structural equals code -- various ways it can evaluate false Assert.False(ExampleModel.StructuralEquals(poly)); Assert.False(Polynomal3Model_Incorrect1.StructuralEquals(poly)); Assert.False(poly.StructuralEquals(Polynomal3Model_Incorrect1)); Assert.False(Polynomal3Model_Incorrect2.StructuralEquals(poly)); Assert.False(poly.StructuralEquals(Polynomal3Model_Incorrect2)); }