61 lines
937 B
Java
61 lines
937 B
Java
|
|
||
|
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)));
|
||
|
}
|
||
|
}
|