Exemple #1
0
        public void GetAdjacentPosition_ShouldThrowWhenNullIsPassedIn()
        {
            var position = new Position(2, 3);

            Action call = () => position.GetAdjacentPosition(null);
            call.ShouldThrow<ArgumentNullException>();
        }
Exemple #2
0
        public void GetAdjacentPosition_ShouldReturnCorrectPosition()
        {
            var position = new Position(2, 3);

            var adjacentPosition =
                position.GetAdjacentPosition(Direction.North);

            adjacentPosition.X.Should().Be(2);
            adjacentPosition.Y.Should().Be(4);
        }
Exemple #3
0
 public LawnMowerState GetStateAfterMoveForward()
 {
     return(new LawnMowerState(
                Position.GetAdjacentPosition(Direction),
                Direction));
 }