public void MoveWithMoveCommandGoingPastYMaximumShouldThrowException() { var establishGrid = new EstablishGridCommand("5 5"); var confirmPosition = new ConfirmPositionCommand("1 2 N"); var move = new MoveCommand("MMMMM"); var commandSet = new CommandSet(establishGrid, confirmPosition, move); var guidance = new LocalRoverGuidance(); Assert.ThrowsException <ArgumentOutOfRangeException>(() => { guidance.Move(commandSet); }); }
public void MoveWithNoMovesShouldHaveCorrectPositionAndHeading() { var establishGrid = new EstablishGridCommand("5 5"); var confirmPosition = new ConfirmPositionCommand("1 2 N"); var move = new MoveCommand(""); var commandSet = new CommandSet(establishGrid, confirmPosition, move); var guidance = new LocalRoverGuidance(); guidance.Move(commandSet); Assert.AreEqual(1, guidance.Coordinates.X); Assert.AreEqual(2, guidance.Coordinates.Y); Assert.AreEqual(Heading.North, guidance.Heading); }