public void Reject_WhenAwaitingReview_SetsReviewedByAndOnFields() { var issue = new devhub_issue { devhub_Description = "Rejecting a solution merge sets reviwed by an reviwed on.", devhub_name = "Set reviewed by and on when solution merge is rejected", devhub_Type = devhub_issue_devhub_type.Feature, devhub_DevelopmentSolution = "devhub_SetReviewFieldsOnRejectOfSolutionMerge", statuscode = devhub_issue_statuscode.InProgress, }; var issueReference = this.CreateTestRecord(issue); var solutionMergeReference = this.CreateTestRecord(new devhub_solutionmerge { devhub_Issue = issueReference, }); this.OrgService.Execute(new devhub_RejectRequest { Target = solutionMergeReference }); var updatedSolutionMerge = this.solutionMergeRepo.Retrieve(solutionMergeReference.Id, new string[] { "devhub_approvedby", "devhub_approvedon" }); Assert.NotNull(updatedSolutionMerge.devhub_ApprovedBy); Assert.NotNull(updatedSolutionMerge.devhub_ApprovedOn); }
public void Create_OtherActiveSolutionMergesForIssue_Throws() { var issue = new devhub_issue { devhub_Description = "Prevent users from creating two active solution merges for an issue.", devhub_name = "Only one active merge allowed for issue", devhub_Type = devhub_issue_devhub_type.Feature, devhub_DevelopmentSolution = "devhub_OnlyOneActiveMergeAllowedForIssue", statuscode = devhub_issue_statuscode.InProgress, }; var issueReference = this.CreateTestRecord(issue); this.CreateTestRecord(new devhub_solutionmerge { devhub_Issue = issueReference, }); Assert.Throws <FaultException <OrganizationServiceFault> >(() => { this.solutionMergeRepo.Create(new devhub_solutionmerge { devhub_Issue = issueReference, }); }); }
public void Cancel_HasAssociatedIssue_SetsIssueStatusToInProgress() { var issue = new devhub_issue { devhub_Description = "Cancelling a solution merge sets issue to 'In Progress'.", devhub_name = "Set issue to In Progress on cancel of solution merge", devhub_Type = devhub_issue_devhub_type.Feature, devhub_DevelopmentSolution = "devhub_SetIssueToInProgressOnCancelOfSolutionMerge", statuscode = devhub_issue_statuscode.InProgress, }; var issueReference = this.CreateTestRecord(issue); var solutionMergeReference = this.CreateTestRecord(new devhub_solutionmerge { devhub_Issue = issueReference, }); this.solutionMergeRepo.Update(new devhub_solutionmerge { devhub_solutionmergeId = solutionMergeReference.Id, statecode = devhub_solutionmergeState.Inactive, statuscode = devhub_solutionmerge_statuscode.Cancelled, }); var updatedIssue = this.issueRepo.Retrieve(issueReference.Id, new string[] { "statuscode" }); Assert.Equal(devhub_issue_statuscode.InProgress, updatedIssue.statuscode); }
public void StartDeveloping_IssueNotToDo_ReturnsError() { var issue = new devhub_issue(); var issueReference = this.CreateTestRecord(issue); issue.devhub_issueId = issueReference.Id; issue.statecode = devhub_issueState.Inactive; issue.statuscode = devhub_issue_statuscode.Cancelled; this.issueRepo.Update(issue); Assert.Throws <FaultException <OrganizationServiceFault> >(() => { var response = (devhub_StartDevelopingResponse)this.OrgService.Execute( new devhub_StartDevelopingRequest { Target = issueReference }); }); }
public void Create_IssueDoesNotHaveADevelopmentSolution_Throws() { var issue = new devhub_issue { devhub_Description = "Error when a solution merge for an issue with no development solution.", devhub_name = "Prevent solution merge creation for issues with no solution", devhub_Type = devhub_issue_devhub_type.Feature, }; var issueReference = this.CreateTestRecord(issue); Assert.Throws <FaultException <OrganizationServiceFault> >(() => { this.solutionMergeRepo.Create(new devhub_solutionmerge { devhub_Issue = issueReference, }); }); }
public void StartDeveloping_IssueToDo_CreatesMatchingSolution() { var issue = new devhub_issue { devhub_Description = "Allow users to start developing a feature.", devhub_name = "Start developing a feature", devhub_Type = devhub_issue_devhub_type.Feature, }; var issueReference = this.CreateTestRecord(issue); var response = (devhub_StartDevelopingResponse)this.OrgService.Execute( new devhub_StartDevelopingRequest { Target = issueReference }); this.CreatedEntities.Add(response.Solution); Assert.NotNull(response.Solution); }
public void Create_NoOtherSolutionMergesForIssue_SetsIssueToDeveloped() { var issue = new devhub_issue { devhub_Description = "Creating a solution merge sets issue to 'Developed'.", devhub_name = "Set issue to developed on create of solution merge", devhub_Type = devhub_issue_devhub_type.Feature, devhub_DevelopmentSolution = "devhub_SetIssueToDevelopedOnCreateOfSolutionMerge", statuscode = devhub_issue_statuscode.InProgress, }; var issueReference = this.CreateTestRecord(issue); this.CreateTestRecord(new devhub_solutionmerge { devhub_Issue = issueReference, }); var updatedIssue = this.issueRepo.Retrieve(issueReference.Id, new string[] { "statuscode" }); Assert.Equal(devhub_issue_statuscode.Developed, updatedIssue.statuscode); }
public void Create_NoOtherSolutionMergesFoIssue_InitialStatusIsAwaitingReview() { var issue = new devhub_issue { devhub_Description = "Solution merge has an initial status of Awaiting Review", devhub_name = "Initial solution merge status is Awaiting Review", devhub_Type = devhub_issue_devhub_type.Feature, devhub_DevelopmentSolution = "devhub_InitialSolutionMergeStatusIsAwaitingReview", statuscode = devhub_issue_statuscode.InProgress, }; var issueReference = this.CreateTestRecord(issue); var solutionMergeReference = this.CreateTestRecord(new devhub_solutionmerge { devhub_Issue = issueReference, }); var updatedSolutionMerge = this.solutionMergeRepo.Retrieve( solutionMergeReference.Id, new string[] { "statuscode" }); Assert.Equal(devhub_solutionmerge_statuscode.AwaitingReview, updatedSolutionMerge.statuscode); }
public void StartDeveloping_IssueToDo_UpdatesDevelopmentSolutionOnIssue() { var expectedDevelopmentSolution = "devhub_StartDevelopingABug"; var issue = new devhub_issue { devhub_Description = "Allow users to start developing a bug.", devhub_name = "Start developing a bug", devhub_Type = devhub_issue_devhub_type.Feature, }; var issueReference = this.CreateTestRecord(issue); var response = (devhub_StartDevelopingResponse)this.OrgService.Execute( new devhub_StartDevelopingRequest { Target = issueReference }); this.CreatedEntities.Add(response.Solution); var updatedIssue = this.issueRepo .Retrieve(issueReference.Id, new string[] { "devhub_developmentsolution" }); Assert.Equal(expectedDevelopmentSolution, updatedIssue.devhub_DevelopmentSolution); }
public void Reject_WhenAwaitingReview_SetsIssueStatusToInProgress() { var issue = new devhub_issue { devhub_Description = "Rejecting a solution merge sets issue to 'In Progress'.", devhub_name = "Set issue to In Progress on reject of solution merge", devhub_Type = devhub_issue_devhub_type.Feature, devhub_DevelopmentSolution = "devhub_SetIssueToInProgressOnRejectOfSolutionMerge", statuscode = devhub_issue_statuscode.InProgress, }; var issueReference = this.CreateTestRecord(issue); var solutionMergeReference = this.CreateTestRecord(new devhub_solutionmerge { devhub_Issue = issueReference, }); this.OrgService.Execute(new devhub_RejectRequest { Target = solutionMergeReference }); var updatedIssue = this.issueRepo.Retrieve(issueReference.Id, new string[] { "statuscode" }); Assert.Equal(devhub_issue_statuscode.InProgress, updatedIssue.statuscode); }