Exemple #1
0
		/// <summary>
		/// This procedure runs all the methods that return geometry objects.
		/// </summary>
		/// <param name="aGeometry">The A geometry</param>
		/// <param name="bGeometry">The B geometry</param>
		/// <param name="testToRun">The method to call on the A geometry</param>
		private void RunGeometryFunction(Geometry aGeometry, Geometry bGeometry, string testToRun)
		{
			_timer.Start();
			// check which test to run...
			switch(testToRun)
			{
				case "convexhull":
					// set the name of the operation for use later...
					this._testResult.Operation = "A.ConvexHull()";
					// call the method and store the returned geometry in 
					// the TestResult object...
					this._testResult.ResultGeometry = aGeometry.ConvexHull();
					SetResultGeometryType(this._testResult.ResultGeometry);
					// Test for pass or fail...
					TestForPassFail();
					break;
				case "getboundary":
					// set the name of the operation for use later...
					this._testResult.Operation = "A.GetBoundary()";
					// call the method and store the returned geometry in 
					// the TestResult object...
					this._testResult.ResultGeometry = aGeometry.GetBoundary();
					SetResultGeometryType(this._testResult.ResultGeometry);
					// Test for pass or fail...
					//TestForPassFailGetBoundary();
					TestForPassFail();
					break;
				case "intersection":
					// set the name of the operation for use later...
					this._testResult.Operation = "A Intersection B";
					// call the method and store the returned geometry in 
					// the TestResult object...
					this._testResult.ResultGeometry = aGeometry.Intersection(bGeometry);
					SetResultGeometryType(this._testResult.ResultGeometry);
					// Test for pass or fail...
					TestForPassFail();
					break;
				case "union":
					// set the name of the operation for use later...
					this._testResult.Operation = "A Union B";
					// call the method and store the returned geometry in 
					// the TestResult object...
					this._testResult.ResultGeometry = aGeometry.Union(bGeometry);
					SetResultGeometryType(this._testResult.ResultGeometry);
					// Test for pass or fail...
					TestForPassFail();
					break;
				case "difference":
					// set the name of the operation for use later...
					this._testResult.Operation = "A Difference B";
					// call the method and store the returned geometry in 
					// the TestResult object...
					this._testResult.ResultGeometry = aGeometry.Difference(bGeometry);
					SetResultGeometryType(this._testResult.ResultGeometry);
					// Test for pass or fail...
					TestForPassFail();
					break;
				case "symdifference":
					// set the name of the operation for use later...
					this._testResult.Operation = "A SymDifference B";
					// call the method and store the returned geometry in 
					// the TestResult object...
					this._testResult.ResultGeometry = aGeometry.SymDifference(bGeometry);
					SetResultGeometryType(this._testResult.ResultGeometry);
					// Test for pass or fail...
					TestForPassFail();
					break;
				case "buffer":
					// set the name of the operation for use later...
					this._testResult.Operation = "A.Buffer";
					// grab the distance of the buffer...
					double bufferDistance = double.Parse(this._op.Arg2);
					// call the method and store the returned geometry in 
					// the TestResult object...
					this._testResult.ResultGeometry = aGeometry.Buffer(bufferDistance);
					SetResultGeometryType(this._testResult.ResultGeometry);
					// Test for pass or fail...
					TestForPassFail();
					break;
				default:
					break;
			}
			// stop the timer...
			_timer.Stop();
			this._testResult.TestDuration = _timer.Seconds;
		}