public void testMoveToOrigin() { PointTests test; test.testMoveToOrigin(); System.out.println("-- testMoveToOrigin --"); System.out.println("Expected x: " + 0); System.out.println("Expected y: " + 0); println("Actual x: " + test.getX()); println("Actual y: " + test.getY()); }
//Example for class RectangleTests public void testSetSmall() { Rectangle rec; rec = new Rectangle(); rec.setSmall(); System.out.println("-- testSetSmall --"); System.out.println("Expected Width: " + 5); System.out.println("Expected Height: " + 1); System.out.println("Actual Width: " + rec.getWidth()); System.out.println("Actual Height: " + rec.getHeight()); }
//Our code for class PointTests (code with bugs) public void testMoveToOrigin() { PointTests test; test.testMoveToOrigin(); System.out.println("-- testMoveToOrigin --"); System.out.println("Expected x: " + 0); System.out.println("Expected y: " + 0); println("Actual x: " + test.getX()); println("Actual y: " + test.getY()); }