187188189190191192193194
@Test public void testPosition4MoveRight() { // { 6, 5, 4, 0, 1, 8, 7, 3, 2 } setGapToPosition4(); board.moveGapRight(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 6, 5, 4, 1, 0, 8, 7, 3, 2 }), board); }
206207208209210211212213
@Test public void testPosition5MoveUp() { // { 6, 5, 4, 1, 0, 8, 7, 3, 2 } setGapToPosition5(); board.moveGapUp(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 6, 0, 4, 1, 5, 8, 7, 3, 2 }), board); }
215216217218219220221222
@Test public void testPosition5MoveDown() { // { 6, 5, 4, 1, 0, 8, 7, 3, 2 } setGapToPosition5(); board.moveGapDown(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 6, 5, 4, 1, 3, 8, 7, 0, 2 }), board); }
224225226227228229230231
@Test public void testPosition5MoveLeft() { // { 6, 5, 4, 1, 0, 8, 7, 3, 2 } setGapToPosition5(); board.moveGapLeft(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 6, 5, 4, 0, 1, 8, 7, 3, 2 }), board); }
233234235236237238239240
@Test public void testPosition5MoveRight() { // { 6, 5, 4, 1, 0, 8, 7, 3, 2 } setGapToPosition5(); board.moveGapRight(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 6, 5, 4, 1, 8, 0, 7, 3, 2 }), board); }
252253254255256257258259
@Test public void testPosition6MoveUp() { // { 6, 5, 4, 1, 8, 0, 7, 3, 2 } setGapToPosition6(); board.moveGapUp(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 6, 5, 0, 1, 8, 4, 7, 3, 2 }), board); }
261262263264265266267268
@Test public void testPosition6MoveDown() { // { 6, 5, 4, 1, 8, 0, 7, 3, 2 } setGapToPosition6(); board.moveGapDown(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 6, 5, 4, 1, 8, 2, 7, 3, 0 }), board); }
270271272273274275276277
@Test public void testPosition6MoveLeft() { // { 6, 5, 4, 1, 8, 0, 7, 3, 2 } setGapToPosition6(); board.moveGapLeft(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 6, 5, 4, 1, 0, 8, 7, 3, 2 }), board); }
279280281282283284285286
@Test public void testPosition6MoveRight() { // { 6, 5, 4, 1, 8, 0, 7, 3, 2 } setGapToPosition6(); board.moveGapRight(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 6, 5, 4, 1, 8, 0, 7, 3, 2 }), board); }
298299300301302303304305
@Test public void testPosition7MoveUp() { // { 6, 5, 4, 7, 1, 8, 0, 3, 2 } setGapToPosition7(); board.moveGapUp(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 6, 5, 4, 0, 1, 8, 7, 3, 2 }), board); }