public async Task ShouldGitHubIdeeHaveLabel() { BotANick.Discord.Program.Main(new string[] { }); var gitHubService = new GitHubService(); var expectedLabel = await gitHubService.Client.Issue.Labels.Get("kitarsh", "botanick", "Idee"); Idee idee = new Idee(); var createdIssue = await gitHubService.AddIssueBasedOnIdee(idee); var issue = await gitHubService.GetLastIssue(); issue.Labels.Select(l => l.Id).Should().Contain(expectedLabel.Id); await ClearIssue(gitHubService, createdIssue); }
public async Task ShouldDetectIfIdeeIsAlreadyGitHubIssue() { BotANick.Discord.Program.Main(new string[] { }); var gitHubService = new GitHubService(); var random = new Random(); Idee idee = new Idee() { Description = random.NextDouble().ToString(), }; var createdIssue = await gitHubService.AddIssueBasedOnIdee(idee); bool isAnIssue = await gitHubService.IsIdeeAnIssue(idee); isAnIssue.Should().BeTrue(); await ClearIssue(gitHubService, createdIssue); }
public async Task ShouldCreateIssueInGitHubFromIdee() { BotANick.Discord.Program.Main(new string[] { }); var gitHubService = new GitHubService(); const string expectedDescription = defaultIssueTitle; Idee idee = new Idee() { Description = expectedDescription, }; var createdIssue = await gitHubService.AddIssueBasedOnIdee(idee); var issue = await gitHubService.GetLastIssue(); issue.Title.Should().Be(expectedDescription); await ClearIssue(gitHubService, createdIssue); }