7778798081828384
@Test public void testPosition2MoveDown() { // { 5, 0, 4, 6, 1, 8, 7, 3, 2 } setGapToPosition2(); board.moveGapDown(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 5, 1, 4, 6, 0, 8, 7, 3, 2 }), board); }
8687888990919293
@Test public void testPosition2MoveLeft() { // { 5, 0, 4, 6, 1, 8, 7, 3, 2 } setGapToPosition2(); board.moveGapLeft(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 0, 5, 4, 6, 1, 8, 7, 3, 2 }), board); }
9596979899100101102
@Test public void testPosition2MoveRight() { // { 5, 0, 4, 6, 1, 8, 7, 3, 2 } setGapToPosition2(); board.moveGapRight(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 5, 4, 0, 6, 1, 8, 7, 3, 2 }), board); }
114115116117118119120121
@Test public void testPosition3MoveUp() { // { 5, 4, 0, 6, 1, 8, 7, 3, 2 } setGapToPosition3(); board.moveGapUp(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 5, 4, 0, 6, 1, 8, 7, 3, 2 }), board); }
123124125126127128129130
@Test public void testPosition3MoveDown() { // { 5, 4, 0, 6, 1, 8, 7, 3, 2 } setGapToPosition3(); board.moveGapDown(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 5, 4, 8, 6, 1, 0, 7, 3, 2 }), board); }
132133134135136137138139
@Test public void testPosition3MoveLeft() { // { 5, 4, 0, 6, 1, 8, 7, 3, 2 } setGapToPosition3(); board.moveGapLeft(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 5, 0, 4, 6, 1, 8, 7, 3, 2 }), board); }
141142143144145146147148
@Test public void testPosition3MoveRight() { // { 5, 4, 0, 6, 1, 8, 7, 3, 2 } setGapToPosition3(); board.moveGapRight(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 5, 4, 0, 6, 1, 8, 7, 3, 2 }), board); }
160161162163164165166167
@Test public void testPosition4MoveUp() { // { 6, 5, 4, 0, 1, 8, 7, 3, 2 } setGapToPosition4(); board.moveGapUp(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 0, 5, 4, 6, 1, 8, 7, 3, 2 }), board); }
169170171172173174175176
@Test public void testPosition4MoveDown() { // { 6, 5, 4, 0, 1, 8, 7, 3, 2 } setGapToPosition4(); board.moveGapDown(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 6, 5, 4, 7, 1, 8, 0, 3, 2 }), board); }
178179180181182183184185
@Test public void testPosition4MoveLeft() { // { 6, 5, 4, 0, 1, 8, 7, 3, 2 } setGapToPosition4(); board.moveGapLeft(); Assert.assertEquals(new EightPuzzleBoard(new int[] { 6, 5, 4, 0, 1, 8, 7, 3, 2 }), board); }