コード例 #1
0
        public void Given_Test_Cases_Should_Pass(string upperBound, string position, string movement, string result)
        {
            Plateu plateu = new Plateu(upperBound);
            Rover  rover  = new Rover(position, plateu);

            rover.CommandRover(movement);
            rover.ToString().Should().Be(result);
        }
コード例 #2
0
        public void Rover_Should_Move_Correctly_When_Instructued(string upperBound, string position, string movement, string result)
        {
            Plateu plateu = new Plateu(upperBound);
            Rover  rover  = new Rover(position, plateu);

            rover.CommandRover(movement);
            rover.ToString().Should().Be(result);
        }
コード例 #3
0
        public void Rover_Should_Throw_Exception_When_Movement_Value_Is_Incorrect(string upperBound, string position, string movement)
        {
            Plateu plateu = new Plateu(upperBound);
            Rover  rover  = new Rover(position, plateu);
            Action action = () => rover.CommandRover(movement);

            action.Should().Throw <ArgumentException>();
        }
コード例 #4
0
        public void Rover_Should_Give_The_Correct_Direction_Data_When_Turned(string upperBound, string position, string movement, string result)
        {
            Plateu plateu = new Plateu(upperBound);
            Rover  rover  = new Rover(position, plateu);

            rover.CommandRover(movement);
            rover.ToString().Should().Be(result);
        }
コード例 #5
0
        public void Rover_Should_Throw_Exception_When_Out_Of_Bounds(string upperBound, string position, string movement)
        {
            Plateu plateu = new Plateu(upperBound);
            Rover  rover  = new Rover(position, plateu);
            Action action = () => rover.CommandRover(movement);

            action.Should().Throw <IndexOutOfRangeException>();
        }