Пример #1
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));
        }
        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));
        }
Пример #3
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 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));
        }
Пример #5
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));
        }