예제 #1
0
        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);
        }
예제 #2
0
        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);
        }