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); }
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); }
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); }