public static void polygon_intersection_point_crossings(PolyPairTestData testData) { if (testData.Name == "Fuzzed: 3") { return; // NOTE: we must test this one a different way } Console.WriteLine(testData.Name); var result = _intersectionOperation.FindPointCrossings(testData.A, testData.B); Assert.NotNull(result); Console.WriteLine("{0} crossing points", result.Count); PolyOperationTestUtility.AssertEqual( testData.CrossingPoints.OrderBy(p => p), result.Select(r => r.Point).OrderBy(p => p), (x, y) => Assert.True(PointsAlmostEqual(x, y), "Points not equal.")); result = _intersectionOperation.FindPointCrossings(testData.B, testData.A); Assert.NotNull(result); PolyOperationTestUtility.AssertEqual( testData.CrossingPoints.OrderBy(p => p), result.Select(r => r.Point).OrderBy(p => p), (x, y) => Assert.True(PointsAlmostEqual(x, y), "Points not equal.")); }
static PolygonXorFacts() { _polyPairData = PolyOperationTestUtility.GeneratePolyPairXorTestDataCollection(); _xorOperation = new PolygonXorOperation(); }
static PolygonDifferenceFacts() { _polyPairData = PolyOperationTestUtility.GeneratePolyPairDifferenceTestDataCollection(); _differenceOperation = new PolygonDifferenceOperation(); }
static PolygonFindPointCrossingsFacts() { _polyPairData = PolyOperationTestUtility.GeneratePolyPairTestDataCollection(); _intersectionOperation = new PolygonIntersectionOperation(); }
static PolygonUnionFacts() { _polyPairData = PolyOperationTestUtility.GeneratePolyPairUnionTestDataCollection(); _unionOperation = new PolygonUnionOperation(); }