Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public GlobalCommand(GitHubEngine engine, IConfigureLogLevel logger) : base(logger)
 {
     _engine = engine;
 }
Esempio n. 3
0
 public RepositoryCommand(GitHubEngine engine, IConfigureLogLevel logger) : base(logger)
 {
     _engine = engine;
 }
Esempio n. 4
0
 public OrganisationCommand(GitHubEngine engine, IConfigureLogLevel logger) : base(logger)
 {
     _engine = engine;
 }