public void ExpandRightElbowDenyTest() { //Arrange RobotAgreggate robot = creator.MakeARobot(); //Action var result = robot.RightElbowExpand(); //Assert result.IsFailure.ShouldBeTrue(); result.Failure.ShouldBeOfType <LimitedElbowExpandException>(); robot.RightElbowPosition.ShouldBe(180); }
private Result <Exception, int> ExecuteActionInRightElbow(RobotAgreggate robot, string action) { switch (action.ToLower()) { case "collapse": return(robot.RightElbowCollapse()); case "expand": return(robot.RightElbowExpand()); default: return(new BussinessException(ErrorCodes.BadRequest, "ElbowAction possui comando inválido.")); } }