25 lines
672 B
Java
25 lines
672 B
Java
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)));
|
|
}
|
|
}
|