public void Move_Action_ShouldChangeXorYby1(int x, int y, char compassDirection, int expectedX, int expectedY) { var plateau = new Plateau(5, 5); var rover = new RoverCuriosity(x, y, compassDirection, plateau); rover.MoveForward(); Assert.That(rover.X() == expectedX); Assert.That(rover.Y() == expectedY); }
public void Move_Action_ShouldThrowException(int x, int y, char compassDirection) { var plateau = new Plateau(5, 5); plateau.AddRover(new RoverCuriosity(1, 1, 'N', plateau)); var rover = new RoverCuriosity(x, y, compassDirection, plateau); plateau.AddRover(rover); Assert.That(() => rover.MoveForward(), Throws.InvalidOperationException); }