public void PlanePositionPointComparerTest_CompareParralelsVectors_ThrowInvalidOperationException(string planeCoordinates, string firstCoordinates, string secondCoordinates) { // 1. Prepare Plane p = new Plane(planeCoordinates); Cartesian3dCoordinate x = new Cartesian3dCoordinate(firstCoordinates); Cartesian3dCoordinate y = new Cartesian3dCoordinate(secondCoordinates); var comparer = new PlanePositionPointComparer(p); // 2. Execute Action result = () => comparer.Compare(x, y); Action reverse = () => comparer.Compare(y, x); // 3. Verify Assert.Throws <InvalidOperationException>(result); Assert.Throws <InvalidOperationException>(reverse); }
public void PlanePositionPointComparerTest_CompareVectors_BeExpected(string planeCoordinates, string firstCoordinates, string secondCoordinates, int expected) { // 1. Prepare Plane p = new Plane(planeCoordinates); Cartesian3dCoordinate x = new Cartesian3dCoordinate(firstCoordinates); Cartesian3dCoordinate y = new Cartesian3dCoordinate(secondCoordinates); var comparer = new PlanePositionPointComparer(p); // 2. Execute int result = comparer.Compare(x, y); int reverse = comparer.Compare(y, x); // 3. Verify Assert.Equal(expected, result); Assert.Equal(-expected, reverse); }