diff --git a/src/test/java/ch/zhaw/pm2/racetrack/CarTest.java b/src/test/java/ch/zhaw/pm2/racetrack/CarTest.java new file mode 100644 index 0000000..eb013c6 --- /dev/null +++ b/src/test/java/ch/zhaw/pm2/racetrack/CarTest.java @@ -0,0 +1,60 @@ + +package ch.zhaw.pm2.racetrack; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +class CarTest { + Car car; + + @BeforeEach + void setUp() { + car = new Car('a', new PositionVector(10, 10)); + } + + @AfterEach + void tearDown() { + } + + @Test + void setPosition() { + car.setPosition(new PositionVector(20, 20)); + checkPosition(20, 20); + } + + @Test + void nextPosition() { + checkPosition(10, 10); + } + + @Test + void accelerate() { + } + + @Test + void move() { + } + + @Test + void crash() { + } + + @Test + void isCrashed() { + } + + @Test + void setMoveStrategy() { + } + + @Test + void getMoveStrategy() { + } + + void checkPosition(int x, int y) { + assertTrue(car.nextPosition().equals(new PositionVector(x, y))); + } +}