// ****************************************************************** // REturn false if should stop public ExecutionState ExtensiveTests() { TestSetOfPoint testSet = GetBasicTestSampleSet(); if (TestAllPossibilitesOnAllQuadrantAndCheckIfShouldStop(testSet) == ExecutionState.Stop) { return(ExecutionState.Stop); } if (TestAllPossibilitesOnAllQuadrantAndCheckIfShouldStop(GetExtensiveTestSet()) == ExecutionState.Stop) { return(ExecutionState.Stop); } return(ExecutionState.Continue); }
// ****************************************************************** public ExecutionState TestAllPossibilitesOnAllQuadrantAndCheckIfShouldStop(TestSetOfPoint testSet) { var actionTestConvexHull = new Func <Point[], ExecutionState>((pts) => TestConvexHull(pts, testSet.ExpectedResult)); Global.Instance.Iteration = 0; //Test proper behavior Q1 Global.Instance.Quadrant = "Q1"; if (Permutations.ForAllPermutation(testSet.Points, actionTestConvexHull) == ExecutionState.Stop) { return(ExecutionState.Stop); } //Test proper behavior Q2 Global.Instance.Quadrant = "Q2"; ConvexHullUtil.InvertCoordinate(testSet.Points, true, false); ConvexHullUtil.InvertCoordinate(testSet.ExpectedResult, true, false); if (Permutations.ForAllPermutation(testSet.Points, actionTestConvexHull) == ExecutionState.Stop) { return(ExecutionState.Stop); } //Test proper behavior Q3 Global.Instance.Quadrant = "Q3"; ConvexHullUtil.InvertCoordinate(testSet.Points, false, true); ConvexHullUtil.InvertCoordinate(testSet.ExpectedResult, false, true); if (Permutations.ForAllPermutation(testSet.Points, actionTestConvexHull) == ExecutionState.Stop) { return(ExecutionState.Stop); } //Test proper behavior Q4 Global.Instance.Quadrant = "Q4"; ConvexHullUtil.InvertCoordinate(testSet.Points, true, false); ConvexHullUtil.InvertCoordinate(testSet.ExpectedResult, true, false); if (Permutations.ForAllPermutation(testSet.Points, actionTestConvexHull) == ExecutionState.Stop) { return(ExecutionState.Stop); } return(ExecutionState.Continue); }