/// <summary> /// Verifies that all methods of the two S2Shapes return identical results, /// except for id() and type_tag(). /// </summary> public static void ExpectEqual(S2Shape a, S2Shape b) { Assert.True(a.NumEdges() == b.NumEdges()); for (int i = 0; i < a.NumEdges(); ++i) { Assert.Equal(a.GetEdge(i), b.GetEdge(i)); Assert.True(a.GetChainPosition(i) == b.GetChainPosition(i)); } Assert.True(a.Dimension() == b.Dimension()); Assert.True(a.GetReferencePoint() == b.GetReferencePoint()); Assert.True(a.NumChains() == b.NumChains()); for (int i = 0; i < a.NumChains(); ++i) { Assert.True(a.GetChain(i) == b.GetChain(i)); int chain_length = a.GetChain(i).Length; for (int j = 0; j < chain_length; ++j) { Assert.True(a.ChainEdge(i, j) == b.ChainEdge(i, j)); } } }