Added Zutil as dependency and added new ground type datafile
This commit is contained in:
parent
c51a473120
commit
3b9422346a
11 changed files with 80 additions and 39 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue