Example #1
0
        public void given_rover_default_when_get_position_called_will_report_default_position()
        {
            var expectedRoverPosition = new string[] { "0", "0", "N" };
            var rover = new RoverNumber2();

            var afterMovingPosition = rover.GetPosition();

            Assert.IsTrue(expectedRoverPosition.SequenceEqual(afterMovingPosition)
                          , $"expected {string.Join(",", expectedRoverPosition)} but got {string.Join(",", afterMovingPosition)}");
        }
Example #2
0
        public void SendMoveAndAssertLocation(string[] currentRoverLocation, string move,
                                              string[] expectedRoverPosition)
        {
            var rover = new RoverNumber2();

            rover.SetCurrentPosition(currentRoverLocation);
            rover.SendCommand(move);
            var afterMovingPosition = rover.GetPosition();

            Assert.IsTrue(expectedRoverPosition.SequenceEqual(afterMovingPosition)
                          , $"expected {string.Join(",", expectedRoverPosition)} but got {string.Join(",", afterMovingPosition)}");
        }