public async Task IssueCommentActionIsNotCreated() { var gitHubMock = GitHubClientMockFactory.CreateDefault(); var eh = new GradeCommandIssueCommentHandler(gitHubMock.CreateFactory(), GradeStoreMockFactory.Default, MemoryCacheMockFactory.Instance, NullLogger.Instance); var result = await eh.Execute(SampleData.CommentDelete); Assert.IsTrue(result.Result.Contains("not of interest", System.StringComparison.InvariantCultureIgnoreCase)); gitHubMock.GitHubClientMock.Verify(c => c.PullRequest.Get(It.IsAny <long>(), It.IsAny <int>()), Times.Never()); }
public async Task IssueCommentNoIssueInPayloadIgnored() { var gitHubMock = GitHubClientMockFactory.CreateDefault(); var payload = SampleData.CommentEdit .Replace("\"issue\": {", "\"aaaaa\": {", System.StringComparison.InvariantCultureIgnoreCase); var eh = new GradeCommandIssueCommentHandler(gitHubMock.CreateFactory(), GradeStoreMockFactory.Default, MemoryCacheMockFactory.Instance, NullLogger.Instance); var result = await eh.Execute(payload); Assert.IsTrue(result.Result.Contains("no issue information", System.StringComparison.InvariantCultureIgnoreCase)); gitHubMock.GitHubClientMock.Verify(c => c.PullRequest.Get(It.IsAny <long>(), It.IsAny <int>()), Times.Never()); }