コード例 #1
0
        public void RotateLeftWristToTheRightDenyBecauseElbowIsntCollapsedTest()
        {
            //Arrange
            creator = new MockCreatorRobot();
            MockRobot robot = ((MockRobot)creator.MakeARobot());

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

            //Assert
            result.IsFailure.ShouldBeTrue();
            result.Failure.ShouldBeOfType <DeniedWristRotateException>();
            robot.LeftWristDirection.ShouldBe(0);
        }
コード例 #2
0
        public void RotateLeftWristToTheRightTest()
        {
            //Arrange
            creator = new MockCreatorRobot();
            MockRobot robot = ((MockRobot)creator
                               .MakeARobot())
                              .WithLeftElbowCollapsed();

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

            //Assert
            result.IsSuccess.ShouldBeTrue();
            result.Success.ShouldBe(-45);
            robot.LeftWristDirection.ShouldBe(-45);
        }
コード例 #3
0
        public void RotateLeftWristToTheRightDenyBecauseItIsLimitedTest()
        {
            //Arrange
            creator = new MockCreatorRobot();
            MockRobot robot = ((MockRobot)creator
                               .MakeARobot())
                              .WithLeftElbowCollapsed()
                              .WithLeftWristLimitedToRightDirection();

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

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