code-coverage-Emilia #24
24
src/test/java/ChestTest.java
Normal file
24
src/test/java/ChestTest.java
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import Entity.Chest;
|
||||||
|
import Entity.Position;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
|
||||||
|
public class ChestTest {
|
||||||
|
private Chest defaultChest() {
|
||||||
|
return new Chest("Lost chest", new Position(0,0));
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void chest_has_a_position() {
|
||||||
|
Chest chest = defaultChest();
|
||||||
|
assertThat(chest.getPosition(), equalTo(new Position(0,0)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void chest_position_can_update() {
|
||||||
|
Chest chest = defaultChest();
|
||||||
|
chest.setPosition(new Position(2,2));
|
||||||
|
assertThat(chest.getPosition(), equalTo(new Position(2,2)));
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user