Example #1
0
        public async Task AhkMonitorConfigYamlInvalid()
        {
            var gitHubMock = GitHubClientMockFactory.CreateCustom()
                             .WithAhkMonitorConfigYamlContent(c => c.ReturnsAsync(new[] { GitHubMockData.CreateAhkMonitorYamlFileContent("not valid content") }));

            var eh     = new TestHandler(gitHubMock.CreateFactory(), MemoryCacheMockFactory.Instance);
            var result = await eh.Execute(SampleData.BranchCreate.Body);

            Assert.IsTrue(result.Result.Contains("no ahk-monitor.yml or disabled", System.StringComparison.InvariantCultureIgnoreCase));
            gitHubMock.GitHubClientMock.Verify(c =>
                                               c.Repository.Content.GetAllContentsByRef(It.IsAny <long>(), ".github/ahk-monitor.yml", It.IsAny <string>()),
                                               Times.Once());
        }
Example #2
0
 public GitHubClientMockFactory WithDefaultAhkMonitorConfigYamlContent()
 => WithAhkMonitorConfigYamlContent(c => c.ReturnsAsync(new[] { GitHubMockData.CreateAhkMonitorYamlFileContent() }));