fixed pathing for 4x4 .txt file and added a simple test for
HighscoreEintrag classmain
parent
1912b74034
commit
47779b0b60
|
@ -6,7 +6,7 @@ public class HighscoreEintrag {
|
||||||
LocalTime time;
|
LocalTime time;
|
||||||
String name;
|
String name;
|
||||||
|
|
||||||
HighscoreEintrag(LocalTime time, String name) {
|
public HighscoreEintrag(LocalTime time, String name) {
|
||||||
this.time = time;
|
this.time = time;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,19 +173,19 @@ public class HitoriMain {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String[] getHighscorePathNames() {
|
public static String[] getHighscorePathNames() {
|
||||||
String[] pathNames = {
|
String[] buttonPaths = {
|
||||||
"src/main/resources/Hitori_Highscores/Hitori4x4_leicht.txt",
|
"resources/Hitori_Highscores/Hitori4x4_leicht.txt",
|
||||||
"resources/Hitori_Highscores/Hitori5x5leicht.txt",
|
"resources/Hitori_Highscores/Hitori5x5leicht.txt",
|
||||||
"resources/Hitori_Highscores/Hitori8x8leicht.txt",
|
"resources/Hitori_Highscores/Hitori8x8leicht.txt",
|
||||||
"resources/Hitori_Highscores/Hitori8x8medium.txt",
|
"resources/Hitori_Highscores/Hitori8x8medium.txt",
|
||||||
"resources/Hitori_Highscores/Hitori10x10medium.txt",
|
"resources/Hitori_Highscores/Hitori10x10medium.txt",
|
||||||
"resources/Hitori_Highscores/Hitori15x15_medium.txt"
|
"resources/Hitori_Highscores/Hitori15x15_medium.txt"
|
||||||
};
|
};
|
||||||
return pathNames;
|
return buttonPaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String[] getHighscoreButtonNames() {
|
public static String[] getHighscoreButtonNames() {
|
||||||
final String[] buttonNames = {
|
String[] buttonNames = {
|
||||||
"Highscore 4x4 - leicht",
|
"Highscore 4x4 - leicht",
|
||||||
"Highscore 5x5 - leicht",
|
"Highscore 5x5 - leicht",
|
||||||
"Highscore 8x8 - leicht",
|
"Highscore 8x8 - leicht",
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
00:02 paul
|
|
||||||
00:02 paul
|
|
||||||
00:02 thomas
|
|
||||||
00:02 thomas
|
|
||||||
00:02 dfopwahgfa
|
|
||||||
00:02 dfopwahgfa
|
|
||||||
00:02 fwagfawgagagas
|
|
||||||
00:02 fwagfawgagagas
|
|
||||||
00:03 fafaadxc
|
|
||||||
00:03 fafaadxc
|
|
||||||
00:04 haveaqniucelife
|
|
||||||
00:04 haveaqniucelife
|
|
|
@ -5,8 +5,11 @@ import org.junit.jupiter.api.Test;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.time.LocalTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import de.hs_mannheim.informatik.mvn.domain.HighscoreEintrag;
|
||||||
import de.hs_mannheim.informatik.mvn.domain.HitoriMain;
|
import de.hs_mannheim.informatik.mvn.domain.HitoriMain;
|
||||||
import de.hs_mannheim.informatik.mvn.gui.GameGUI;
|
import de.hs_mannheim.informatik.mvn.gui.GameGUI;
|
||||||
|
|
||||||
|
@ -327,48 +330,6 @@ class HitoriTest{
|
||||||
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 = HitoriMain.getSolution(inputStream);
|
|
||||||
InputStream newStream = getClass().getResourceAsStream(path);
|
|
||||||
int rows = 4;
|
|
||||||
String[][] data = HitoriMain.getData(newStream, rows);
|
|
||||||
assertTrue(Arrays.deepEquals(ergebnis1, HitoriMain.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 = HitoriMain.getSolution(inputStream);
|
|
||||||
InputStream newStream = getClass().getResourceAsStream(path);
|
|
||||||
int rows = 4;
|
|
||||||
String[][] data = HitoriMain.getData(newStream, rows);
|
|
||||||
assertFalse(Arrays.deepEquals(ergebnis1, HitoriMain.getErgebnisArray(data, filteredData)));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void test24() throws IOException {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void test25() throws IOException {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void getErgebnisArrayTest1() throws IOException {
|
void getErgebnisArrayTest1() throws IOException {
|
||||||
String[][] ergebnis1 = {
|
String[][] ergebnis1 = {
|
||||||
|
@ -384,9 +345,8 @@ class HitoriTest{
|
||||||
String[][] data = HitoriMain.getData(newStream, rows);
|
String[][] data = HitoriMain.getData(newStream, rows);
|
||||||
assertTrue(Arrays.deepEquals(ergebnis1, HitoriMain.getErgebnisArray(data, filteredData)));
|
assertTrue(Arrays.deepEquals(ergebnis1, HitoriMain.getErgebnisArray(data, filteredData)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@Test
|
|
||||||
void getErgebnisArrayTest2() throws IOException {
|
void getErgebnisArrayTest2() throws IOException {
|
||||||
String[][] ergebnis1 = {
|
String[][] ergebnis1 = {
|
||||||
{"W", "W", "W", "W"},
|
{"W", "W", "W", "W"},
|
||||||
|
@ -401,6 +361,27 @@ class HitoriTest{
|
||||||
String[][] data = HitoriMain.getData(newStream, rows);
|
String[][] data = HitoriMain.getData(newStream, rows);
|
||||||
assertFalse(Arrays.deepEquals(ergebnis1, HitoriMain.getErgebnisArray(data, filteredData)));
|
assertFalse(Arrays.deepEquals(ergebnis1, HitoriMain.getErgebnisArray(data, filteredData)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void highscoreEintragGetterTest() {
|
||||||
|
LocalTime time = LocalTime.of(10, 00);
|
||||||
|
HighscoreEintrag he = new HighscoreEintrag(time, "Berat");
|
||||||
|
assertTrue(he.getName().equals("Berat"));
|
||||||
|
LocalTime parsedTime = LocalTime.parse("10:00");
|
||||||
|
assertTrue(he.getTime().equals(parsedTime));
|
||||||
|
LocalTime wrongParsedTime = LocalTime.parse("11:00");
|
||||||
|
assertFalse(he.getTime().equals(wrongParsedTime));
|
||||||
|
assertFalse(he.getName().equals("Emre"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test void test17() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue