- Methoden überarbeitet
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
package ch.zhaw.pm2.racetrack;
|
||||
|
||||
import ch.zhaw.pm2.racetrack.given.ConfigSpecification;
|
||||
import org.junit.Before;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class TrackTest {
|
||||
Track trackObj;
|
||||
|
||||
@@ -45,7 +48,31 @@ public class TrackTest {
|
||||
//TODO:
|
||||
@Test
|
||||
void addCarAtInit() {
|
||||
trackObj.addCar();
|
||||
try {
|
||||
trackObj.addCar();
|
||||
} catch (InvalidTrackFormatException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
void findFinish() {
|
||||
List<PositionVector> expected = new ArrayList<>();
|
||||
expected.add(new PositionVector(22,22));
|
||||
expected.add(new PositionVector(22,23));
|
||||
expected.add(new PositionVector(22,24));
|
||||
Assertions.assertEquals(expected,trackObj.getFinishLine());
|
||||
}
|
||||
|
||||
@Test
|
||||
void makeTrackObj() {
|
||||
try {
|
||||
Track t1 = new Track(new File("C:\\Studium\\Semester2\\PM2\\Projekt1\\racetrack\\tracks\\challenge.txt"));
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvalidTrackFormatException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user