new Test for getErgebnus Array Method

main
Emre Durak 2025-01-05 21:08:21 +01:00
parent b4d3ee05d6
commit da1104718f
1 changed files with 26 additions and 0 deletions

View File

@ -329,4 +329,30 @@ class HitoriTest{
ArrayList<String> ergebnisList = HitoriMain2.readFromFile(inputStream);
assertNotEquals(fileEntry, ergebnisList);
}
@Test
void test22() throws IOException {
String[][] ergebnis1 = {
{"W", "B", "W", "W"},
{"W", "W", "W", "B"},
{"W", "B", "W", "W"},
{"B", "W", "W", "B"}};
String path = "/Hitori_Spielfelder/Hitori4x4_leicht.csv";
InputStream inputStream = getClass().getResourceAsStream(path);
ArrayList<String> filteredData = HitoriMain2.getSolution(inputStream);
InputStream newStream = getClass().getResourceAsStream(path);
int rows = 4;
String[][] data = HitoriMain2.getData(newStream, rows);
assertTrue(Arrays.deepEquals(ergebnis1, HitoriMain2.getErgebnisArray(data, filteredData)));
}
}