package slide; import slide.utility.*; public class UtilityTest { public static void main(String[] args) { BoardFileSyntaxCheckerAndReader initialBoard = new BoardFileSyntaxCheckerAndReader("slide/utilityTestBoardOne"); BoardFileSyntaxCheckerAndReader finalBoard = new BoardFileSyntaxCheckerAndReader("slide/utilityTestBoardTwo"); SolutionChecker checkerOne = // We have the same start and stop board and a zero // length array of solution moves. // This will be valid. new SolutionChecker(initialBoard, initialBoard, new SolutionMove[0]); System.out.print("0 moves from one board to the same board is "); if (checkerOne.isSolutionValid()) { System.out.println("valid! Everything is OK."); } else { System.out.println("NOT VALID! THERE IS A PROBLEM!"); } SolutionChecker checkerTwo = // From one board to a differnet board with no move. // This should not be valid. new SolutionChecker(initialBoard, finalBoard, new SolutionMove[0]); System.out.print("0 moves from one board to another is "); if (checkerTwo.isSolutionValid()) { System.out.println("VALID! THERE IS A PROBLEM!"); } else { System.out.println("not valid! Everything is OK. " + "(You should see an error message above)."); } SolutionChecker checkerThree = // From one board to another will null moves. // This will be valid, but is not correct (for these // particular boards). There is no (easy) way for us to // check here your assertion that there is no series of moves // to connect the two boards. This is a big part of your // job on the project (the correctness component). new SolutionChecker(initialBoard, finalBoard, null); System.out.print("null moves from one board to another is "); if (checkerThree.isSolutionValid()) { System.out.println("valid! Everything is OK."); } else { System.out.println("NOT VALID! THERE IS A PROBLEM!"); } } }