Skip to content

Commit

Permalink
(GH-365) Add method to close comment thread (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
twenzel authored Sep 26, 2022
1 parent f5a5503 commit 9eb27c0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,20 @@ public void Should_Resolve_Comment_Thread()
// ?? Nothing to validate here since the method returns void
}

[Fact]
public void Should_Resolve_Close_Thread()
{
// Given
var fixture = new PullRequestFixture(BasePullRequestFixture.ValidAzureDevOpsUrl, 21);
var pullRequest = new AzureDevOpsPullRequest(fixture.Log, fixture.Settings, fixture.GitClientFactory);

// When
pullRequest.CloseCommentThread(123);

// Then
// ?? Nothing to validate here since the method returns void
}

[Fact]
public void Should_Not_Throw_If_Null_Is_Returned()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,15 @@ public void ActivateCommentThread(int threadId)
this.SetCommentThreadStatus(threadId, CommentThreadStatus.Active);
}

/// <summary>
/// Sets the pull request comment thread to <see cref="CommentThreadStatus.Closed"/>.
/// </summary>
/// <param name="threadId">The Id of the comment thread.</param>
public void CloseCommentThread(int threadId)
{
this.SetCommentThreadStatus(threadId, CommentThreadStatus.Closed);
}

/// <summary>
/// Creates a new comment thread with a single comment in the pull request.
/// </summary>
Expand Down

0 comments on commit 9eb27c0

Please sign in to comment.