예제 #1
0
        public void ChangeDirection()
        {
            Rover myRover = new Rover();

            myRover.X = 2;
            myRover.Y = 2;

            myRover.Direction = Direction.N;

            myRover.ChangeDirection('L');
            Assert.AreEqual(myRover.Direction, Direction.W);

            myRover.ChangeDirection('R');
            Assert.AreEqual(myRover.Direction, Direction.N);
        }
예제 #2
0
        [Test] // tests to change direction of Rover
        public void i1_CommandLeft_ChangesDirectionFrom_East_ToNorth()
        {
            rover.direction = 'e';// reset direction from above test case's direction
            string command = "l";

            rover.PrintStatus();
            rover.ChangeDirection(command);
            rover.PrintStatus();
            char expectedDirection = 'n';

            Assert.AreEqual(expectedDirection, rover.direction);
        }
예제 #3
0
 public void ChangeDirection(char direction)
 {
     _rover.ChangeDirection(direction);
 }
예제 #4
0
 public void ChangeDirection(int directionChange, string expectedDirection)
 {
     _rover.ChangeDirection(directionChange);
     _rover.CurrentDirection.Should().Be(expectedDirection);
 }