public string Execute(IList <string> inputParameters)
        {
            //Assign Values From List Of Parameters
            string teamToShowBoardActivityFor = inputParameters[0];
            string boardActivityToShow        = inputParameters[1];

            //Validations
            var teamTypeForChecking = "Team Name";

            inputValidator.IsNullOrEmpty(teamToShowBoardActivityFor, teamTypeForChecking);

            var boardTypeForChecking = "Board Name";

            inputValidator.IsNullOrEmpty(boardActivityToShow, boardTypeForChecking);

            businessLogicValidator.ValidateTeamExistance(allTeams, teamToShowBoardActivityFor);

            businessLogicValidator.ValidateBoardExistanceInTeam(allTeams, boardActivityToShow, teamToShowBoardActivityFor);

            //Operations
            var boardToDisplayActivityFor = allTeams.AllTeamsList[teamToShowBoardActivityFor].Boards
                                            .Where(boardInSelectedTeam => boardInSelectedTeam.Name == boardActivityToShow)
                                            .FirstOrDefault();

            var boardActivityToString = boardOperations.ShowBoardActivityToString(boardToDisplayActivityFor);

            return(string.Format(boardActivityToString));
        }
        public string Execute(IList <string> inputParameters)
        {
            string boardToAddToTeam     = inputParameters[0];
            string teamForAddingBoardTo = inputParameters[1];

            //Validations
            var boardTypeForChecking = "Board Name";

            inputValidator.IsNullOrEmpty(boardToAddToTeam, boardTypeForChecking);

            var teamTypeForChecking = "Person Name";

            inputValidator.IsNullOrEmpty(teamForAddingBoardTo, teamTypeForChecking);

            inputValidator.ValdateBoardNameLength(boardToAddToTeam);

            businessLogicValidator.ValidateTeamExistance(allTeams, teamForAddingBoardTo);

            businessLogicValidator.ValidateBoardAlreadyInTeam(allTeams, boardToAddToTeam, teamForAddingBoardTo);

            //Operations
            var team  = allTeams.AllTeamsList[teamForAddingBoardTo];
            var board = this.factory.CreateBoard(boardToAddToTeam);

            teamOperations.AddBoard(team, board);

            return(string.Format(BoardAddedToTeam, boardToAddToTeam, teamForAddingBoardTo));
        }
Пример #3
0
        public string Execute(IList <string> inputParameters)
        {
            //Assign Values From List Of Parameters
            string personToAddToTeam = inputParameters[0];
            string teamToAddPersonTo = inputParameters[1];

            //Validations
            var personTypeForChecking = "Person Name";

            inputValidator.IsNullOrEmpty(personToAddToTeam, personTypeForChecking);

            var teamTypeForChecking = "Team Name";

            inputValidator.IsNullOrEmpty(teamToAddPersonTo, teamTypeForChecking);

            businessLogicValidator.ValidateTeamExistance(allTeams, teamToAddPersonTo);

            businessLogicValidator.ValidateMemberExistance(allMembers, personToAddToTeam);

            businessLogicValidator.ValidateIfMemberAlreadyInTeam(allTeams, teamToAddPersonTo, personToAddToTeam);

            //Operations
            var teamToAddMember = allTeams.AllTeamsList[teamToAddPersonTo];

            this.teamOperations.AddMember(teamToAddMember, allMembers.AllMembersList[personToAddToTeam]);
            return(string.Format(PersonAddedToTeam, personToAddToTeam, teamToAddPersonTo));
        }
Пример #4
0
        public string Execute(IList <string> inputParameters)
        {
            //Assign Values
            string feedbackTitle         = inputParameters[0];
            string teamToAddFeedbackFor  = inputParameters[1];
            string boardToAddFeedbackFor = inputParameters[2];
            string feedbackRaiting       = inputParameters[3];
            string feedbackStatus        = inputParameters[4];
            var    feedbackDescription   = descriptionBuilder.BuildDescription(inputParameters, 5);

            //Validations
            var feedbackTypeForChecking = "Feedback Title";

            inputValidator.IsNullOrEmpty(feedbackTitle, feedbackTypeForChecking);

            var teamTypeForChecking = "Team Name";

            inputValidator.IsNullOrEmpty(teamToAddFeedbackFor, teamTypeForChecking);

            var boardTypeForChecking = "Board Name";

            inputValidator.IsNullOrEmpty(boardToAddFeedbackFor, boardTypeForChecking);

            inputValidator.ValdateItemTitleLength(feedbackTitle);

            inputValidator.ValdateItemDescriptionLength(feedbackDescription);

            businessLogicValidator.ValidateTeamExistance(allTeams, teamToAddFeedbackFor);

            businessLogicValidator.ValidateBoardExistanceInTeam(allTeams, boardToAddFeedbackFor, teamToAddFeedbackFor);

            businessLogicValidator.ValidateFeedbackExistanceInBoard(allTeams, boardToAddFeedbackFor, teamToAddFeedbackFor, feedbackTitle);

            var intFeedbackRating = inputValidator.ValidateRatingConversion(feedbackRaiting);

            //Operations
            var isEnumConvertable = Enum.TryParse(feedbackStatus, out FeedbackStatus feedbackStatusEnum);

            inputValidator.IsEnumConvertable(isEnumConvertable, "FeedbackStatus");

            IFeedback feedbackToAddToCollection = this.factory.CreateFeedback(feedbackTitle, feedbackDescription, intFeedbackRating, feedbackStatusEnum);

            var indexOfBoardInSelectedTeam = allTeams.AllTeamsList[teamToAddFeedbackFor].Boards.FindIndex(boardIndex => boardIndex.Name == boardToAddFeedbackFor);

            boardOperations.AddWorkitemToBoard(allTeams.AllTeamsList[teamToAddFeedbackFor].Boards[indexOfBoardInSelectedTeam], feedbackToAddToCollection);
            boardOperations.AddActivityHistoryToBoard(allTeams.AllTeamsList[teamToAddFeedbackFor].Boards[indexOfBoardInSelectedTeam], feedbackToAddToCollection);

            return(string.Format(FeedbackCreated, feedbackTitle));
        }
        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));
        }
        public string Execute(IList <string> inputParameters)
        {
            //Assign Values From List Of Parameters
            string statusToFilterBugFor = inputParameters[0];

            //Validations
            var statusTypeForChecking = "Status";

            inputValidator.IsNullOrEmpty(statusToFilterBugFor, statusTypeForChecking);

            businessLogicValidator.ValidateIfAnyWorkItemsExist(allTeams);

            businessLogicValidator.ValidateIfAnyBugsExist(allTeams);

            //Operations
            var isPriorityEnumConvertable = Enum.TryParse(statusToFilterBugFor, out BugStatus bugStatusToCheckFor);

            inputValidator.IsEnumConvertable(isPriorityEnumConvertable, "Status");


            var filteredBugsByStatus = allTeams.AllTeamsList.Values
                                       .SelectMany(x => x.Boards)
                                       .SelectMany(x => x.WorkItems)
                                       .Where(x => x.GetType() == typeof(Bug))
                                       .Select(workItem => (Bug)workItem)
                                       .Where(bug => bug.BugStatus == bugStatusToCheckFor)
                                       .ToList();


            StringBuilder sb = new StringBuilder();
            long          workItemCounter = 1;

            if (filteredBugsByStatus.Count == 0)
            {
                sb.AppendLine($"There are no Bugs with: {statusToFilterBugFor} Status in the app yet!");
            }
            else
            {
                sb.AppendLine($"----ALL BUGS WITH {statusToFilterBugFor} STATUS IN APPLICAITION----");
                foreach (var item in filteredBugsByStatus)
                {
                    sb.AppendLine($"{workItemCounter}. {item.GetType().Name} with name: {item.Title} ");
                    workItemCounter++;
                }
                sb.AppendLine("---------------------------------");
            }

            var resultedAllItems = sb.ToString().Trim();

            return(string.Format(resultedAllItems));
        }
Пример #7
0
        public string Execute(IList <string> inputParameters)
        {
            //Assign Values From List Of Parameters
            string priorityToFilterStoryFor = inputParameters[0];

            //Validations
            var priorityTypeForChecking = "Priority";

            inputValidator.IsNullOrEmpty(priorityToFilterStoryFor, priorityTypeForChecking);

            businessLogicValidator.ValidateIfAnyWorkItemsExist(allTeams);

            businessLogicValidator.ValidateIfAnyStoriesExist(allTeams);

            //Operations
            var isStatusEnumConvertable = Enum.TryParse(priorityToFilterStoryFor, out Priority priorityToCheckFor);

            inputValidator.IsEnumConvertable(isStatusEnumConvertable, "Priority");

            var filteredStoriesByPriority = allTeams.AllTeamsList.Values
                                            .SelectMany(x => x.Boards)
                                            .SelectMany(x => x.WorkItems)
                                            .Where(x => x.GetType() == typeof(Story))
                                            .Select(workItem => (Story)workItem)
                                            .Where(story => story.Priority == priorityToCheckFor)
                                            .ToList();


            StringBuilder sb = new StringBuilder();
            long          workItemCounter = 1;

            if (filteredStoriesByPriority.Count == 0)
            {
                sb.AppendLine($"There are no Stories with: {priorityToFilterStoryFor} Status in the app yet!");
            }
            else
            {
                sb.AppendLine($"----ALL STORIES WITH {priorityToFilterStoryFor} PRIORITY IN APPLICAITION----");
                foreach (var item in filteredStoriesByPriority)
                {
                    sb.AppendLine($"{workItemCounter}. {item.GetType().Name} with name: {item.Title} ");
                    workItemCounter++;
                }
                sb.AppendLine("---------------------------------");
            }

            var resultedAllItems = sb.ToString().Trim();

            return(string.Format(resultedAllItems));
        }
        public string Execute(IList <string> inputParameters)
        {
            //Assign Values From List Of Parameters
            string teamToShowMembersFor = inputParameters[0];

            var teamTypeForChecking = "Team Name";

            inputValidator.IsNullOrEmpty(teamToShowMembersFor, teamTypeForChecking);

            businessLogicValidator.ValidateTeamExistance(allTeams, teamToShowMembersFor);

            var teamToShowMembers          = allTeams.AllTeamsList[teamToShowMembersFor];
            var allTeamMembersStringResult = teamOperations.ShowAllTeamMembers(teamToShowMembers);

            return(string.Format(allTeamMembersStringResult));
        }
        public string Execute(IList <string> inputParameters)
        {
            //Assign Values From List Of Parameters
            string assigneeToFilterBugFor = inputParameters[0];

            //Validations
            var assigneeTypeForChecking = "Assignee";

            inputValidator.IsNullOrEmpty(assigneeToFilterBugFor, assigneeTypeForChecking);

            businessLogicValidator.ValidateIfAnyWorkItemsExist(allTeams);

            businessLogicValidator.ValidateIfAnyBugsExist(allTeams);

            //Operations
            var filteredBugsByAssignee = allTeams.AllTeamsList.Values
                                         .SelectMany(x => x.Boards)
                                         .SelectMany(x => x.WorkItems)
                                         .Where(x => x.GetType() == typeof(Bug))
                                         .Select(workItem => (Bug)workItem)
                                         .Where(bug => bug.Assignee.Name == assigneeToFilterBugFor)
                                         .ToList();


            StringBuilder sb = new StringBuilder();
            long          workItemCounter = 1;

            if (filteredBugsByAssignee.Count == 0)
            {
                sb.AppendLine($"There are no Bugs with: {assigneeToFilterBugFor} Assignee in the app yet!");
            }
            else
            {
                sb.AppendLine($"----ALL BUGS ASSIGNED TO MEMBER: {assigneeToFilterBugFor} IN APPLICAITION----");
                foreach (var item in filteredBugsByAssignee)
                {
                    sb.AppendLine($"{workItemCounter}. {item.GetType().Name} with name: {item.Title} ");
                    workItemCounter++;
                }
                sb.AppendLine("---------------------------------");
            }

            var resultedAllItems = sb.ToString().Trim();

            return(string.Format(resultedAllItems));
        }
        public string Execute(IList <string> inputParameters)
        {
            string teamName = inputParameters[0];
            //Validations
            var inputTypeForChecking = "Team Name";

            inputValidator.IsNullOrEmpty(teamName, inputTypeForChecking);

            businessLogicValidator.ValidateIfTeamExists(allTeams, teamName);

            //Operations
            var team = this.factory.CreateTeam(teamName);

            allTeamsOperations.AddTeam(allTeams, team);

            return(string.Format(TeamCreated, teamName));
        }
        public string Execute(IList <string> inputParameters)
        {
            string personName = inputParameters[0];
            //Validations
            var personTypeForChecking = "Person Name";

            inputValidator.IsNullOrEmpty(personName, personTypeForChecking);

            inputValidator.ValdateMemberNameLength(personName);

            businessLogicValidator.ValidateIfPersonExists(allMembers, personName);

            //Operations
            var person = this.factory.CreateMember(personName, allTeams);

            allMembersOperations.AddMember(allMembers, person);

            return(string.Format(PersonCreated, personName));
        }
        public string Execute(IList <string> inputParameters)
        {
            //Assign Values From List Of Parameters
            string memberName = inputParameters[0];

            //Validations
            var inputTypeForChecking = "Member Name";

            inputValidator.IsNullOrEmpty(memberName, inputTypeForChecking);

            businessLogicValidator.ValidateMemberExistance(allMembers, memberName);

            //Operations
            var selectedMember = this.allMembers.AllMembersList[memberName];

            var memberActivities = memberOperations.ShowMemberActivityToString(selectedMember);

            return(string.Format(memberActivities));
        }
        public string Execute(IList <string> inputParameters)
        {
            //Assign Values From List Of Parameters
            string teamName = inputParameters[0];

            //Validations
            var inputTypeForChecking = "Team Name";

            inputValidator.IsNullOrEmpty(teamName, inputTypeForChecking);

            businessLogicValidator.ValdateIfAnyTeamsExist(allTeams);

            businessLogicValidator.ValidateTeamExistance(allTeams, teamName);

            //Operations
            var teamToCheckHistoryFor = allTeams.AllTeamsList[teamName];

            var teamActivityHistory = teamOperations.ShowTeamActivityToString(teamToCheckHistoryFor);

            return(string.Format(teamActivityHistory));
        }
Пример #14
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)
        {
            //Assign Values From List Of Parameters
            string factorToSortBy = inputParameters[0];

            //Validations
            var factorTypeForChecking = $"{factorToSortBy}";

            inputValidator.IsNullOrEmpty(factorToSortBy, factorTypeForChecking);

            businessLogicValidator.ValidateIfAnyWorkItemsExist(allTeams);

            businessLogicValidator.ValidateIfAnyStoriesExist(allTeams);

            //Operations
            var filteredStories = new List <Story>();

            if (factorToSortBy.ToLower() == "title")
            {
                filteredStories = allTeams.AllTeamsList.Values
                                  .SelectMany(x => x.Boards)
                                  .SelectMany(x => x.WorkItems)
                                  .Where(x => x.GetType() == typeof(Story))
                                  .Select(workItem => (Story)workItem)
                                  .OrderBy(storyToOrder => storyToOrder.Title)
                                  .ToList();
            }
            else if (factorToSortBy.ToLower() == "priority")
            {
                filteredStories = allTeams.AllTeamsList.Values
                                  .SelectMany(x => x.Boards)
                                  .SelectMany(x => x.WorkItems)
                                  .Where(x => x.GetType() == typeof(Story))
                                  .Select(workItem => (Story)workItem)
                                  .OrderBy(storyToOrder => storyToOrder.Priority)
                                  .ToList();
            }
            else if (factorToSortBy.ToLower() == "status")
            {
                filteredStories = allTeams.AllTeamsList.Values
                                  .SelectMany(x => x.Boards)
                                  .SelectMany(x => x.WorkItems)
                                  .Where(x => x.GetType() == typeof(Story))
                                  .Select(workItem => (Story)workItem)
                                  .OrderBy(storyToOrder => storyToOrder.StoryStatus)
                                  .ToList();
            }
            else if (factorToSortBy.ToLower() == "size")
            {
                filteredStories = allTeams.AllTeamsList.Values
                                  .SelectMany(x => x.Boards)
                                  .SelectMany(x => x.WorkItems)
                                  .Where(x => x.GetType() == typeof(Story))
                                  .Select(workItem => (Story)workItem)
                                  .OrderBy(storyToOrder => storyToOrder.Size)
                                  .ToList();
            }
            StringBuilder sb = new StringBuilder();

            sb.AppendLine($"----ALL STORIES IN APPLICAITION SORTED BY {factorToSortBy}----");
            long workItemCounter = 1;

            foreach (var item in filteredStories)
            {
                sb.AppendLine($"{workItemCounter}. {item.GetType().Name} with name: {item.Title} ");
                workItemCounter++;
            }
            sb.AppendLine("---------------------------------");

            var resultedAllItems = sb.ToString().Trim();

            return(string.Format(resultedAllItems));
        }
Пример #16
0
        public string Execute(IList <string> inputParameters)
        {
            string bugTitle         = inputParameters[0];
            string teamToAddBugFor  = inputParameters[1];
            string boardToAddBugFor = inputParameters[2];
            string bugPriority      = inputParameters[3];
            string bugSeverity      = inputParameters[4];
            string bugAssignee      = inputParameters[5];

            IList <string> bugStepsToReproduce = stepsToReproduceBuilder.BuildStepsToReproduce(inputParameters, "!Steps");

            var bugDescription = descriptionBuilder.BuildDescription(inputParameters, "!Steps");

            //Validations
            var bugTypeForChecking = "Bug Title";

            inputValidator.IsNullOrEmpty(bugTitle, bugTypeForChecking);

            var teamTypeForChecking = "Team Name";

            inputValidator.IsNullOrEmpty(teamToAddBugFor, teamTypeForChecking);

            var boardTypeForChecking = "Board Name";

            inputValidator.IsNullOrEmpty(boardToAddBugFor, boardTypeForChecking);

            inputValidator.ValdateItemTitleLength(bugTitle);

            inputValidator.ValdateItemDescriptionLength(bugDescription);

            businessLogicValidator.ValidateTeamExistance(allTeams, teamToAddBugFor);

            businessLogicValidator.ValidateMemberExistance(allMembers, bugAssignee);

            businessLogicValidator.ValidateIfMemberNotInTeam(allTeams, teamToAddBugFor, bugAssignee);

            businessLogicValidator.ValidateBugExistanceInBoard(allTeams, boardToAddBugFor, teamToAddBugFor, bugTitle);

            //Operations
            var isPriorityEnumConvertable = Enum.TryParse(bugPriority, out Priority bugPriorityEnum);

            inputValidator.IsEnumConvertable(isPriorityEnumConvertable, "Priority");

            var isSeverityEnumConvertable = Enum.TryParse(bugSeverity, out Severity bugSeverityEnum);

            inputValidator.IsEnumConvertable(isSeverityEnumConvertable, "Severity");

            IBug bugToAddToCollection = this.factory.CreateBug(bugTitle, bugPriorityEnum, bugSeverityEnum, allMembers.AllMembersList[bugAssignee], bugStepsToReproduce, bugDescription);

            var indexOfBoardInSelectedTeam = allTeams.AllTeamsList[teamToAddBugFor].Boards.FindIndex(boardIndex => boardIndex.Name == boardToAddBugFor);

            boardOperations.AddWorkitemToBoard(allTeams.AllTeamsList[teamToAddBugFor].Boards[indexOfBoardInSelectedTeam], bugToAddToCollection);

            var memberToTrackActivityFor = allTeams.AllTeamsList[teamToAddBugFor].Members.First(member => member.Name == bugAssignee);

            memberOpertaions.AddWorkItemIdToMember(memberToTrackActivityFor, bugToAddToCollection.Id);

            var boardToPutHistoryFor = allTeams.AllTeamsList[teamToAddBugFor].Boards[indexOfBoardInSelectedTeam];
            var teamToPutHistoryFor  = allTeams.AllTeamsList[teamToAddBugFor];

            boardOperations.AddActivityHistoryToBoard(allTeams.AllTeamsList[teamToAddBugFor].Boards[indexOfBoardInSelectedTeam], memberToTrackActivityFor, bugToAddToCollection);
            memberOpertaions.AddActivityHistoryToMember(memberToTrackActivityFor, bugToAddToCollection, teamToPutHistoryFor, boardToPutHistoryFor);

            return(string.Format(BugCreated, bugTitle));
        }
        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));
        }
        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));
        }
        public string Execute(IList <string> inputParameters)
        {
            string storyTitle         = inputParameters[0];
            string teamToAddStoryFor  = inputParameters[1];
            string boardToAddStoryFor = inputParameters[2];
            string storyPriority      = inputParameters[3];
            string storySize          = inputParameters[4];
            string storyStatus        = inputParameters[5];
            string storyAssignee      = inputParameters[6];
            var    storyDescription   = descriptionBuilder.BuildDescription(inputParameters, 7);

            //Validations
            var storyTypeForChecking = "Story Title";

            inputValidator.IsNullOrEmpty(storyTitle, storyTypeForChecking);

            var teamTypeForChecking = "Team Name";

            inputValidator.IsNullOrEmpty(teamToAddStoryFor, teamTypeForChecking);

            var boardTypeForChecking = "Board Name";

            inputValidator.IsNullOrEmpty(boardToAddStoryFor, boardTypeForChecking);

            inputValidator.ValdateItemTitleLength(storyTitle);

            inputValidator.ValdateItemDescriptionLength(storyDescription);

            businessLogicValidator.ValidateTeamExistance(allTeams, teamToAddStoryFor);

            businessLogicValidator.ValidateMemberExistance(allMembers, storyAssignee);

            businessLogicValidator.ValidateIfMemberNotInTeam(allTeams, teamToAddStoryFor, storyAssignee);

            businessLogicValidator.ValidateBoardExistanceInTeam(allTeams, boardToAddStoryFor, teamToAddStoryFor);

            businessLogicValidator.ValidateStoryExistanceInBoard(allTeams, boardToAddStoryFor, teamToAddStoryFor, storyTitle);

            //Operations

            var isPriorityEnumConvertable = Enum.TryParse(storyPriority, out Priority storyPriorityEnum);

            inputValidator.IsEnumConvertable(isPriorityEnumConvertable, "Priority");

            var isSizeEnumConvertable = Enum.TryParse(storySize, out Size storySizeEnum);

            inputValidator.IsEnumConvertable(isSizeEnumConvertable, "Size");

            var isStatusEnumConvertable = Enum.TryParse(storyStatus, out StoryStatus storyStatusEnum);

            inputValidator.IsEnumConvertable(isStatusEnumConvertable, "Status");

            IStory storyToAddToCollection = this.factory.CreateStory(storyTitle, storyDescription, storyPriorityEnum, storySizeEnum, storyStatusEnum, allMembers.AllMembersList[storyAssignee]);

            var indexOfBoardInSelectedTeam = allTeams.AllTeamsList[teamToAddStoryFor].Boards.FindIndex(boardIndex => boardIndex.Name == boardToAddStoryFor);

            boardOperations.AddWorkitemToBoard(allTeams.AllTeamsList[teamToAddStoryFor].Boards[indexOfBoardInSelectedTeam], storyToAddToCollection);

            var memberToPutHistoryFor = allTeams.AllTeamsList[teamToAddStoryFor].Members.First(member => member.Name == storyAssignee);

            memberOpertaions.AddWorkItemIdToMember(memberToPutHistoryFor, storyToAddToCollection.Id);

            var boardToPutHistoryFor = allTeams.AllTeamsList[teamToAddStoryFor].Boards[indexOfBoardInSelectedTeam];
            var teamToPutHistoryFor  = allTeams.AllTeamsList[teamToAddStoryFor];

            boardOperations.AddActivityHistoryToBoard(allTeams.AllTeamsList[teamToAddStoryFor].Boards[indexOfBoardInSelectedTeam], memberToPutHistoryFor, storyToAddToCollection);

            memberOpertaions.AddActivityHistoryToMember(memberToPutHistoryFor, storyToAddToCollection, teamToPutHistoryFor, boardToPutHistoryFor);

            return(string.Format(StoryCreated, storyTitle));
        }
Пример #20
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));
        }