private static GitHubEngine MakeGithubEngine( int repoEngineResult, List <RepositorySettings> repos) { var github = Substitute.For <IGitHub>(); var repoDiscovery = Substitute.For <IGitHubRepositoryDiscovery>(); var repoEngine = Substitute.For <IGitHubRepositoryEngine>(); var folders = Substitute.For <IFolderFactory>(); var githubCreator = Substitute.For <ICreate <IGitHub> >(); var repoEngineCreator = Substitute.For <ICreate <IGitHubRepositoryEngine> >(); github.GetCurrentUser().Returns( RepositoryBuilder.MakeUser("http://test.user.com")); githubCreator.Create(null).ReturnsForAnyArgs(github); repoDiscovery.GetRepositories(Arg.Any <IGitHub>(), Arg.Any <SourceControlServerSettings>()) .Returns(repos); repoEngine.Run(null, null, null, null).ReturnsForAnyArgs(repoEngineResult); repoEngineCreator.Create(null).ReturnsForAnyArgs(repoEngine); var engine = new GitHubEngine(githubCreator, repoDiscovery, repoEngineCreator, folders, Substitute.For <INuKeeperLogger>()); return(engine); }
public GlobalCommand(GitHubEngine engine, IConfigureLogLevel logger) : base(logger) { _engine = engine; }
public RepositoryCommand(GitHubEngine engine, IConfigureLogLevel logger) : base(logger) { _engine = engine; }
public OrganisationCommand(GitHubEngine engine, IConfigureLogLevel logger) : base(logger) { _engine = engine; }