Added Test for Method getID in CarTest.java

This commit is contained in:
romanschenk37 2022-03-07 17:43:32 +01:00
parent 40cd4f7b72
commit dea430e418
1 changed files with 7 additions and 1 deletions

View File

@ -21,13 +21,19 @@ class CarTest {
// Default coordinates for tests // Default coordinates for tests
int DEFAULT_X = 10; int DEFAULT_X = 10;
int DEFAULT_Y = 10; int DEFAULT_Y = 10;
char DEFAULT_ID = 'f';
/** /**
* Create a new Car Object and set Position to a defined Default Position * Create a new Car Object and set Position to a defined Default Position
*/ */
@BeforeEach @BeforeEach
void setUp() { void setUp() {
car = new Car('a', new PositionVector(DEFAULT_X, DEFAULT_Y)); car = new Car(DEFAULT_ID, new PositionVector(DEFAULT_X, DEFAULT_Y));
}
@Test
void getID() {
assertEquals(DEFAULT_ID, car.getID());
} }
/** /**