Added Zutil as dependency and added new ground type datafile

This commit is contained in:
Ziver Koc 2020-01-04 20:03:57 +01:00
parent c51a473120
commit 3b9422346a
11 changed files with 80 additions and 39 deletions

View file

@ -6,16 +6,24 @@ import java.security.InvalidParameterException;
import static org.junit.jupiter.api.Assertions.*;
class GroundFactoryTest {
class GroundTypeFactoryTest {
@Test
void invalidIDTest() {
assertThrows(InvalidParameterException.class, () -> {
GroundTypeFactory.get(-1);
});
assertThrows(InvalidParameterException.class, () -> {
GroundTypeFactory.get(500);
});
}
@Test
void get() {
assertThrows(InvalidParameterException.class, () -> {
GroundFactory.get(-1);
});
assertThrows(InvalidParameterException.class, () -> {
GroundFactory.get(500);
});
GroundType ground = GroundTypeFactory.get(0);
assertNotNull(ground);
assertSame(ground, GroundTypeFactory.get(0));
assertEquals("Grass", ground.getName());
}
}