Browse Source

changed ModelTest.java the toString test. Comparing of returned string with an static string

remotes/origin/develop
fdai6499 2 years ago
parent
commit
abf623a328
  1. 21
      src/test/java/ModelTest.java

21
src/test/java/ModelTest.java

@ -9,6 +9,7 @@ public class ModelTest extends MainFrame {
@Test @Test
public void test_toString() { public void test_toString() {
GameField gameField = new GameField(360); GameField gameField = new GameField(360);
for (int i = 0; i < 9; i++) { for (int i = 0; i < 9; i++) {
@ -19,7 +20,23 @@ public class ModelTest extends MainFrame {
Model model = new Model(gameField); Model model = new Model(gameField);
System.out.println(model);
String staticCase =
"X 0 1 2 3 4 5 6 7 8\n" +
" ------------------------\n" +
"0 | 0 0 0 0 0 0 0 0 0\n" +
"1 | 1 1 1 1 1 1 1 1 1\n" +
"2 | 2 2 2 2 2 2 2 2 2\n" +
" |\n" +
"3 | 3 3 3 3 3 3 3 3 3\n" +
"4 | 4 4 4 4 4 4 4 4 4\n" +
"5 | 5 5 5 5 5 5 5 5 5\n" +
" |\n" +
"6 | 6 6 6 6 6 6 6 6 6\n" +
"7 | 7 7 7 7 7 7 7 7 7\n" +
"8 | 8 8 8 8 8 8 8 8 8\n";
assertEquals(model.toString(), staticCase, "tested Overridden toString of Model.class");
} }
@Test @Test
@ -115,7 +132,7 @@ public class ModelTest extends MainFrame {
} }
} }
assertTrue(a);
assertTrue(a, "arrangement of set values of parsing from GameField");
} }
@Test @Test

Loading…
Cancel
Save