test commit
parent
b4d3ee05d6
commit
fda2097eea
|
@ -6,10 +6,24 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.time.LocalTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.format.DateTimeFormatterBuilder;
|
||||||
|
import java.time.temporal.ChronoField;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
|
||||||
import de.hs_mannheim.informatik.mvn.domain.HitoriMain2;
|
import de.hs_mannheim.informatik.mvn.domain.HitoriMain2;
|
||||||
import de.hs_mannheim.informatik.mvn.gui.GameGUI;
|
import de.hs_mannheim.informatik.mvn.gui.GameGUI;
|
||||||
|
|
||||||
|
@ -329,4 +343,48 @@ class HitoriTest{
|
||||||
ArrayList<String> ergebnisList = HitoriMain2.readFromFile(inputStream);
|
ArrayList<String> ergebnisList = HitoriMain2.readFromFile(inputStream);
|
||||||
assertNotEquals(fileEntry, ergebnisList);
|
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)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void test23() throws IOException {
|
||||||
|
String[][] ergebnis1 = {
|
||||||
|
{"W", "W", "W", "W"},
|
||||||
|
{"W", "W", "W", "W"},
|
||||||
|
{"W", "W", "W", "W"},
|
||||||
|
{"W", "W", "W", "W"}};
|
||||||
|
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);
|
||||||
|
assertFalse(Arrays.deepEquals(ergebnis1, HitoriMain2.getErgebnisArray(data, filteredData)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void test24() throws IOException {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void test25() throws IOException {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue