private static Container GetGitHubIssueCreator() { var gitHubRepoInfo = new GitHubRepoInfo("CreateMask", "Devoney", "username", "password"); var issuesClientMock = new Mock <IIssuesClient>(); var gitHubIssueCreator = new GitHubIssueCreator(issuesClientMock.Object, gitHubRepoInfo); var container = new Container(gitHubIssueCreator, issuesClientMock, gitHubRepoInfo); issuesClientMock .Setup(ic => ic.Create(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <NewIssue>())) .Callback(new Action <string, string, NewIssue>((argOwner, argName, newIssue) => { container.NewIssue = newIssue; })) .Returns(Task.Run(new Func <Issue>(() => null))); return(container); }
public Container(GitHubIssueCreator gitHubIssueCreator, Mock <IIssuesClient> issuesClientMock, GitHubRepoInfo gitHubRepoInfo) { GitHubIssueCreator = gitHubIssueCreator; IssuesClientMock = issuesClientMock; GitHubRepoInfo = gitHubRepoInfo; }