You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
608 B
20 lines
608 B
package xu.problem.pathfinding;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
class PositionTest {
|
|
|
|
@Test
|
|
void next() {
|
|
Position position = new Position(5, 6);
|
|
assertEquals(position.next(new Move(Direction.S)), new Position(6, 6));
|
|
|
|
Position next = (Position) position.next(new Move(Direction.E)); // (5,7)
|
|
assertEquals(next, new Position(5, 7));
|
|
assertEquals(next.next(new Move(Direction.N)), new Position(4, 7));
|
|
assertEquals(next.next(new Move(Direction.W)), new Position(5, 6));
|
|
|
|
}
|
|
} |