/** * Accuracy Test of the <code>setEndingPoint(Point)</code> and <code>getEndingPoint()</code> * methods. */ public void testEndingPoint_Operation() { // get the attribute endPoint to check the get operation. assertEquals("The endPoint default to Point(0, 0).", new Point(0, 0), test.getEndingPoint()); Point newPoint = new Point(2, 4); // set the endPoint. test.setEndingPoint(newPoint); // get the attribute endPoint to check the set operation. assertEquals("The endPoint should be Point(2, 4).", newPoint, test.getEndingPoint()); }
/** Accuracy Test of the <code>EdgeEnding</code>'s constructor. */ public void testConstructor() { // creat a new instance to check the constructor. assertNotNull("Constructor should work well.", new MockEdgeEnding()); // get the attribute endPoint to check the constructor. assertEquals("The endPoint default to Point(0, 0).", new Point(0, 0), test.getEndingPoint()); }