3 import static org
.junit
.Assert
.*;
7 import com
.github
.puzzles
.core
.Difficulty
;
8 import com
.github
.puzzles
.core
.FlippingPuzzle
;
9 import com
.github
.puzzles
.core
.SlidingPuzzle
;
10 import com
.github
.puzzles
.util
.Matrices
;
11 import java
.util
.Arrays
;
12 import static org
.hamcrest
.CoreMatchers
.is
;
14 public class MatricesTest
{
16 public static void main(String
[] argv
){
21 public void swapTest() {
22 SlidingPuzzle sp
= new SlidingPuzzle(5, 5);
23 Integer
[][] puzzle
= sp
.getPuzzle();
24 Integer
[] items
= new Integer
[25];
25 Arrays
.fill(items
, 0, 25, 0);
26 for (int i
= 0; i
< 5; i
++) {
27 for (int j
= 0; j
< 5; j
++) {
28 items
[puzzle
[i
][j
]]++;
32 for (Integer item
: items
) {
33 assertThat(item
, is(1));