public string Execute(IList <string> inputParameters)
        {
            //Assign Values From List Of Parameters
            string teamToAddCommentToWorkItemFor  = inputParameters[0];
            string boardToAddCommentToWorkItemFor = inputParameters[1];
            string itemTypeToAddWorkItemFor       = inputParameters[2];
            string workitemToAddCommentFor        = inputParameters[3];
            string authorOfComment = inputParameters[4];
            string commentToAdd    = inputParameters[5];

            //Validations
            var itemTypeForChecking = "Item Title";

            inputValidator.IsNullOrEmpty(workitemToAddCommentFor, itemTypeForChecking);

            var teamTypeForChecking = "Team Name";

            inputValidator.IsNullOrEmpty(teamToAddCommentToWorkItemFor, teamTypeForChecking);

            var boardTypeForChecking = "Board Name";

            inputValidator.IsNullOrEmpty(boardToAddCommentToWorkItemFor, boardTypeForChecking);

            var authorTypeForChecking = "Author";

            inputValidator.IsNullOrEmpty(authorOfComment, authorTypeForChecking);

            businessLogicValidator.ValidateTeamExistance(allTeams, teamToAddCommentToWorkItemFor);

            businessLogicValidator.ValidateBoardExistanceInTeam(allTeams, boardToAddCommentToWorkItemFor, teamToAddCommentToWorkItemFor);

            businessLogicValidator.ValidateIfAnyWorkItemsExist(allTeams);

            businessLogicValidator.ValidateItemExistanceInBoard(allTeams, boardToAddCommentToWorkItemFor, teamToAddCommentToWorkItemFor, workitemToAddCommentFor);

            //Operations
            var workItemToAddCommentTo = allTeams.FindWorkItem(teamToAddCommentToWorkItemFor, itemTypeToAddWorkItemFor, boardToAddCommentToWorkItemFor, workitemToAddCommentFor);

            workItemOperations.AddComment(workItemToAddCommentTo, commentToAdd, authorOfComment);

            return(string.Format(AddedCommentFor, commentToAdd, authorOfComment, itemTypeToAddWorkItemFor, workitemToAddCommentFor));
        }
예제 #2
0
        public string Execute(IList <string> inputParametes)
        {
            //Assign Values
            string teamToAssignUnsignItem  = inputParametes[0];
            string boardToAssignUnsignItem = inputParametes[1];
            string itemType           = inputParametes[2];
            string itemToAssignUnsign = inputParametes[3];
            string memberToAssignItem = inputParametes[4];

            //Validations
            var itemTypeForChecking = "Item Title";

            inputValidator.IsNullOrEmpty(itemToAssignUnsign, itemTypeForChecking);

            var teamTypeForChecking = "Team Name";

            inputValidator.IsNullOrEmpty(teamToAssignUnsignItem, teamTypeForChecking);

            var boardTypeForChecking = "Board Name";

            inputValidator.IsNullOrEmpty(boardToAssignUnsignItem, boardTypeForChecking);

            var authorTypeForChecking = "Author";

            inputValidator.IsNullOrEmpty(memberToAssignItem, authorTypeForChecking);

            businessLogicValidator.ValidateTeamExistance(allTeams, teamToAssignUnsignItem);

            businessLogicValidator.ValidateMemberExistance(allMembers, memberToAssignItem);

            businessLogicValidator.ValidateBoardExistanceInTeam(allTeams, boardToAssignUnsignItem, teamToAssignUnsignItem);

            //Operations
            var itemMemberToAssign = allTeams.FindMemberInTeam(teamToAssignUnsignItem, memberToAssignItem);

            var itemToChangeIn = allTeams.FindWorkItem(teamToAssignUnsignItem, itemType, boardToAssignUnsignItem, itemToAssignUnsign);

            IMember itemMemberBeforeUnssign = null;

            if (itemType == "Bug")
            {
                var typedItem = (Bug)itemToChangeIn;

                itemMemberBeforeUnssign = typedItem.Assignee;

                bugOperations.AssignMemberToBug(typedItem, itemMemberToAssign);

                memberOpertaions.RemoveWorkItemIdToMember(itemMemberToAssign, typedItem.Id);

                memberOpertaions.AddWorkItemIdToMember(itemMemberToAssign, typedItem.Id);
            }
            else if (itemType == "Story")
            {
                var typedItem = (Story)itemToChangeIn;

                itemMemberBeforeUnssign = typedItem.Assignee;

                storyOperations.AssignMemberToStory(typedItem, itemMemberToAssign);

                memberOpertaions.RemoveWorkItemIdToMember(itemMemberToAssign, typedItem.Id);

                memberOpertaions.AddWorkItemIdToMember(itemMemberToAssign, typedItem.Id);
            }

            //history
            var indexOfBoardInSelectedTeam = allTeams.AllTeamsList[teamToAssignUnsignItem].Boards.FindIndex(boardIndex => boardIndex.Name == boardToAssignUnsignItem);

            //add history to board
            boardOperations.AddActivityHistoryAfterAssignUnsignToBoard(allTeams.AllTeamsList[teamToAssignUnsignItem].Boards[indexOfBoardInSelectedTeam], itemType, itemToAssignUnsign, itemMemberToAssign, itemMemberBeforeUnssign);

            //add history to member before unssign

            memberOpertaions.AddActivityHistoryAfterUnsignToMember(itemMemberBeforeUnssign, itemType, itemToAssignUnsign);

            //add history to member after assign
            memberOpertaions.AddActivityHistoryAfterAssignToMember(itemMemberToAssign, itemType, itemToAssignUnsign);

            return(string.Format(AssignItemTo, itemType, itemToAssignUnsign, boardToAssignUnsignItem, teamToAssignUnsignItem, memberToAssignItem));
        }
        public string Execute(IList <string> inputParameters)
        {
            string teamToChangeBugSeverityFor  = inputParameters[0];
            string boardToChangeBugSeverityFor = inputParameters[1];
            string bugToChangeSeverityFor      = inputParameters[2];
            string newSeverity = inputParameters[3];
            string authorOfBugSeverityChange = inputParameters[4];

            //Validations
            var bugTypeForChecking = "Bug Title";

            inputValidator.IsNullOrEmpty(bugToChangeSeverityFor, bugTypeForChecking);

            var teamTypeForChecking = "Team Name";

            inputValidator.IsNullOrEmpty(teamToChangeBugSeverityFor, teamTypeForChecking);

            var boardTypeForChecking = "Board Name";

            inputValidator.IsNullOrEmpty(boardToChangeBugSeverityFor, boardTypeForChecking);

            var severityTypeForChecking = "Severity";

            inputValidator.IsNullOrEmpty(newSeverity, severityTypeForChecking);

            var authorTypeForChecking = "Author";

            inputValidator.IsNullOrEmpty(authorOfBugSeverityChange, authorTypeForChecking);

            businessLogicValidator.ValidateTeamExistance(allTeams, teamToChangeBugSeverityFor);

            businessLogicValidator.ValidateBoardExistanceInTeam(allTeams, boardToChangeBugSeverityFor, teamToChangeBugSeverityFor);

            businessLogicValidator.ValidateNoSuchBugInBoard(allTeams, boardToChangeBugSeverityFor, teamToChangeBugSeverityFor, bugToChangeSeverityFor);

            //Operations
            var itemType = "Bug";

            var isEnumConvertable = Enum.TryParse(newSeverity, out Severity newSeverityEnum);

            inputValidator.IsEnumConvertable(isEnumConvertable, "Severity");

            var castedBugForPriorityChange = allTeams.FindBugAndCast(teamToChangeBugSeverityFor, boardToChangeBugSeverityFor, bugToChangeSeverityFor);

            bugOperations.ChangeBugSeverity(castedBugForPriorityChange, newSeverityEnum);

            var memberToAddActivityFor = allTeams.FindMemberInTeam(teamToChangeBugSeverityFor, authorOfBugSeverityChange);

            var teamToAddActivityFor = allTeams.AllTeamsList[teamToChangeBugSeverityFor];

            var bugToAddActivityFor = allTeams.FindWorkItem(teamToChangeBugSeverityFor, itemType, boardToChangeBugSeverityFor, bugToChangeSeverityFor);

            var teamToFindIn = allTeams.AllTeamsList[teamToChangeBugSeverityFor];

            var boardToAddActivityFor = allTeams.FindBoardInTeam(teamToChangeBugSeverityFor, boardToChangeBugSeverityFor);

            boardOperations.AddActivityHistoryToBoard(boardToAddActivityFor, memberToAddActivityFor, bugToAddActivityFor, newSeverity);

            memberOpertaions.AddActivityHistoryToMember(memberToAddActivityFor, bugToAddActivityFor, teamToFindIn, boardToAddActivityFor, newSeverity);

            bugOperations.AddActivityHistoryToWorkItem(bugToAddActivityFor, memberToAddActivityFor, newSeverity);

            return(string.Format(BugSeverityChanged, bugToChangeSeverityFor, newSeverityEnum));
        }
예제 #4
0
        public string Execute(IList <string> inputParameters)
        {
            string teamToChangeStoryStatusFor  = inputParameters[0];
            string boardToChangeStoryStatusFor = inputParameters[1];
            string storyToChangeStatusFor      = inputParameters[2];
            string newStoryStatus            = inputParameters[3];
            string authorOfStoryStatusChange = inputParameters[4];

            //Validations
            var storyTypeForChecking = "Story Title";

            inputValidator.IsNullOrEmpty(storyToChangeStatusFor, storyTypeForChecking);

            var teamTypeForChecking = "Team Name";

            inputValidator.IsNullOrEmpty(teamToChangeStoryStatusFor, teamTypeForChecking);

            var boardTypeForChecking = "Board Name";

            inputValidator.IsNullOrEmpty(boardToChangeStoryStatusFor, boardTypeForChecking);

            var statusTypeForChecking = "Status";

            inputValidator.IsNullOrEmpty(newStoryStatus, statusTypeForChecking);

            var authorTypeForChecking = "Author";

            inputValidator.IsNullOrEmpty(authorOfStoryStatusChange, authorTypeForChecking);

            businessLogicValidator.ValidateTeamExistance(allTeams, teamToChangeStoryStatusFor);

            businessLogicValidator.ValidateBoardExistanceInTeam(allTeams, boardToChangeStoryStatusFor, teamToChangeStoryStatusFor);

            businessLogicValidator.ValidateNoSuchStoryInBoard(allTeams, boardToChangeStoryStatusFor, teamToChangeStoryStatusFor, storyToChangeStatusFor);


            //Operations
            var itemType = "Story";

            var isEnumConvertable = Enum.TryParse(newStoryStatus, out StoryStatus newStatusEnum);

            inputValidator.IsEnumConvertable(isEnumConvertable, "Status");

            var castedStoryForStatusChange = allTeams.FindStoryAndCast(teamToChangeStoryStatusFor, boardToChangeStoryStatusFor, storyToChangeStatusFor);

            storyOperations.ChangeStoryStatus(castedStoryForStatusChange, newStatusEnum);

            var memberToAddActivityFor = allTeams.FindMemberInTeam(teamToChangeStoryStatusFor, authorOfStoryStatusChange);

            var teamToAddActivityFor = allTeams.AllTeamsList[teamToChangeStoryStatusFor];

            var storyToAddActivityFor = allTeams.FindWorkItem(teamToChangeStoryStatusFor, itemType, boardToChangeStoryStatusFor, storyToChangeStatusFor);

            var teamToFindIn = allTeams.AllTeamsList[teamToChangeStoryStatusFor];

            var boardToAddActivityFor = allTeams.FindBoardInTeam(teamToChangeStoryStatusFor, boardToChangeStoryStatusFor);

            boardOperations.AddActivityHistoryToBoard(boardToAddActivityFor, memberToAddActivityFor, storyToAddActivityFor, newStoryStatus);

            memberOpertaions.AddActivityHistoryToMember(memberToAddActivityFor, storyToAddActivityFor, teamToFindIn, boardToAddActivityFor, newStoryStatus);

            storyOperations.AddActivityHistoryToWorkItem(storyToAddActivityFor, memberToAddActivityFor, newStoryStatus);

            return(string.Format(StoryStatusChanged, storyToChangeStatusFor, newStatusEnum));
        }
        public string Execute(IList <string> inputParameters)
        {
            string teamToChangeFeedbackRatingFor  = inputParameters[0];
            string boardToChangeFeedbackRatingFor = inputParameters[1];
            string feedbackToChangeRatingFor      = inputParameters[2];
            string newFeedbackRating            = inputParameters[3];
            string authorOfFeedbackRatingChange = inputParameters[4];

            //Validations
            var feedbackTypeForChecking = "Feedback Title";

            inputValidator.IsNullOrEmpty(feedbackToChangeRatingFor, feedbackTypeForChecking);

            var teamTypeForChecking = "Team Name";

            inputValidator.IsNullOrEmpty(teamToChangeFeedbackRatingFor, teamTypeForChecking);

            var boardTypeForChecking = "Board Name";

            inputValidator.IsNullOrEmpty(boardToChangeFeedbackRatingFor, boardTypeForChecking);

            var ratingTypeForChecking = "Rating";

            inputValidator.IsNullOrEmpty(newFeedbackRating, ratingTypeForChecking);

            var authorTypeForChecking = "Author";

            inputValidator.IsNullOrEmpty(authorOfFeedbackRatingChange, authorTypeForChecking);

            businessLogicValidator.ValidateTeamExistance(allTeams, teamToChangeFeedbackRatingFor);

            businessLogicValidator.ValidateBoardExistanceInTeam(allTeams, boardToChangeFeedbackRatingFor, teamToChangeFeedbackRatingFor);

            businessLogicValidator.ValidateNoSuchFeedbackInBoard(allTeams, boardToChangeFeedbackRatingFor, teamToChangeFeedbackRatingFor, feedbackToChangeRatingFor);

            var integerRating = inputValidator.ValidateRatingConversion(newFeedbackRating);

            //Operations
            var itemType = "Feedback";

            var castedFeedbackForRatingChange = allTeams.FindFeedbackAndCast(teamToChangeFeedbackRatingFor, boardToChangeFeedbackRatingFor, feedbackToChangeRatingFor);

            feedbackOperations.ChangeFeedbackRating(castedFeedbackForRatingChange, integerRating);

            var memberToAddActivityFor = allTeams.FindMemberInTeam(teamToChangeFeedbackRatingFor, authorOfFeedbackRatingChange);

            var teamToAddActivityFor = allTeams.AllTeamsList[teamToChangeFeedbackRatingFor];

            var feedbackToAddActivityFor = allTeams.FindWorkItem(teamToChangeFeedbackRatingFor, itemType, boardToChangeFeedbackRatingFor, feedbackToChangeRatingFor);

            var teamToFindIn = allTeams.AllTeamsList[teamToChangeFeedbackRatingFor];

            var boardToAddActivityFor = allTeams.FindBoardInTeam(teamToChangeFeedbackRatingFor, boardToChangeFeedbackRatingFor);

            boardOperations.AddActivityHistoryToBoard(boardToAddActivityFor, memberToAddActivityFor, feedbackToAddActivityFor, newFeedbackRating);

            memberOpertaions.AddActivityHistoryToMember(memberToAddActivityFor, feedbackToAddActivityFor, teamToFindIn, boardToAddActivityFor, newFeedbackRating);

            feedbackOperations.AddActivityHistoryToWorkItem(feedbackToAddActivityFor, memberToAddActivityFor, newFeedbackRating);

            return(string.Format(FeedbackRatingChanged, feedbackToChangeRatingFor, integerRating));
        }