Exemple #1
0
        public void ExecuteScoop()
        {
            const bool scoopUpwards = true;

            $"Given a scoop upwards command of {scoopUpwards}"
            .x(() => TestInstance.ScoopUpwards = scoopUpwards);

            "When a scoop command is executed"
            .x(() => TestInstance.Execute());

            "Then the robot is issued a command to scoop"
            .x(() => GetDependency <IRobot>().Verify(d => d.Scoop(scoopUpwards)));
        }
        public void ExecuteRotation(double leftRotation)
        {
            leftRotation = Faker.Random.Double(1, 360);

            $"Given a rotation angle of {leftRotation} degrees"
            .x(() => TestInstance.LeftRotation = leftRotation);

            "When a rotate command is executed"
            .x(() => TestInstance.Execute());

            "Then the robot is issued a command to rotate left the supplied rotation angle"
            .x(() => GetDependency <IRobot>().Verify(d => d.RotateLeft(leftRotation)));
        }
Exemple #3
0
        public void ExecuteMovement(int forwardDistance)
        {
            forwardDistance = Faker.Random.Int(1, 1000);

            $"Given a forward movement distance of {forwardDistance} mm"
            .x(() => TestInstance.ForwardDistance = forwardDistance);

            "When a move command is executed"
            .x(() => TestInstance.Execute());

            "Then the robot is issued a command to move forwards the supplied movement distance"
            .x(() => GetDependency <IRobot>().Verify(d => d.Move(forwardDistance)));
        }