Ejemplo n.º 1
0
        public void RotateLeftWristToTheLeftDenyBecauseElbowIsntCollapsedTest()
        {
            //Arrange
            creator = new MockCreatorRobot();
            MockRobot robot = ((MockRobot)creator.MakeARobot());

            //Action
            var result = robot.LeftWristRotateToTheLeft();

            //Assert
            result.IsFailure.ShouldBeTrue();
            result.Failure.ShouldBeOfType <DeniedWristRotateException>();
            robot.LeftWristDirection.ShouldBe(0);
        }
Ejemplo n.º 2
0
        public void RotateLeftWristToTheLeftTest()
        {
            //Arrange
            creator = new MockCreatorRobot();
            MockRobot robot = ((MockRobot)creator
                               .MakeARobot())
                              .WithLeftElbowCollapsed();

            //Action
            var result = robot.LeftWristRotateToTheLeft();

            //Assert
            result.IsSuccess.ShouldBeTrue();
            result.Success.ShouldBe(45);
            robot.LeftWristDirection.ShouldBe(45);
        }
Ejemplo n.º 3
0
        public void RotateLeftWristToTheLeftDenyBecauseItIsLimitedTest()
        {
            //Arrange
            creator = new MockCreatorRobot();
            MockRobot robot = ((MockRobot)creator
                               .MakeARobot())
                              .WithLeftElbowCollapsed()
                              .WithLeftWristLimitedToLeftDirection();

            //Action
            var result = robot.LeftWristRotateToTheLeft();

            //Assert
            result.IsFailure.ShouldBeTrue();
            result.Failure.ShouldBeOfType <LimitedWristRotateException>();
            robot.LeftWristDirection.ShouldBe(180);
        }