/** * TestPosition Class * - Tests the Position Class * @author Akbar Sherwani * @date 22nd Decemeber * @version 0.1 */ public class TestPosition { Position pos1; Position pos2; public TestPosition() { System.out.println("Testing Position Class:"); // Intilase Class pos1 = new Position(4.0, 5.0); pos2 = new Position(-10.0, 6.5); // Run Tests and final call if(testGetx() && testGety()) { System.out.println("Position Class Passed :)"); System.out.println("-------------------------------"); } else { System.out.println("Position Class Failed"); System.out.println("-------------------------------"); } } public static void main(String[] args) { new TestPosition(); } public boolean testGetx() { if(pos1.getPosx() == 4.0) { System.out.println("Set and Get Test Passed"); return true; } else { System.out.println("! Set and Get Test Failed"); return false; } } public boolean testGety() { if(pos2.getPosy() == 6.5) { System.out.println("Set and Get Test Passed"); return true; } else { System.out.println("! Set and Get Test Failed"); return false; } } }