Exemple #1
0
        private static LocalEngine MakeLocalEngine(IUpdateFinder finder, ILocalUpdater updater)
        {
            var reader = Substitute.For <INuGetSourcesReader>();

            finder.FindPackageUpdateSets(
                Arg.Any <IFolder>(), Arg.Any <NuGetSources>(),
                Arg.Any <VersionChange>(),
                Arg.Any <UsePrerelease>())
            .Returns(new List <PackageUpdateSet>());

            var sorter = Substitute.For <IPackageUpdateSetSort>();

            sorter.Sort(Arg.Any <IReadOnlyCollection <PackageUpdateSet> >())
            .Returns(x => x.ArgAt <IReadOnlyCollection <PackageUpdateSet> >(0));

            var logger = Substitute.For <INuKeeperLogger>();

            var nugetLogger = Substitute.For <NuGet.Common.ILogger>();

            var reporter = Substitute.For <IReporter>();

            var engine = new LocalEngine(reader, finder, sorter, updater,
                                         reporter, logger, nugetLogger);

            Assert.That(engine, Is.Not.Null);
            return(engine);
        }
 public RepositoryUpdaterCreator(INuKeeperLogger logger, INuGetSourcesReader sourcesReader,
                                 IUpdateFinder updateFinder, ICreate <IPackageUpdater> packageUpdaterCreator,
                                 SolutionsRestore solutionRestore, IAvailableUpdatesReporter reporter, ICreate <IPackageUpdateSelection> packageUpdateSelectionCreator)
 {
     _logger                        = logger;
     _sourcesReader                 = sourcesReader;
     _updateFinder                  = updateFinder;
     _packageUpdaterCreator         = packageUpdaterCreator;
     _solutionRestore               = solutionRestore;
     _reporter                      = reporter;
     _packageUpdateSelectionCreator = packageUpdateSelectionCreator;
 }
Exemple #3
0
 public LocalEngine(
     INuGetSourcesReader nuGetSourcesReader,
     IUpdateFinder updateFinder,
     IPackageUpdateSetSort sorter,
     ICreate<ILocalUpdater> updaterCreator,
     INuKeeperLogger logger)
 {
     _nuGetSourcesReader = nuGetSourcesReader;
     _updateFinder = updateFinder;
     _sorter = sorter;
     _updaterCreator = updaterCreator;
     _logger = logger;
 }
 public LocalEngine(
     INuGetSourcesReader nuGetSourcesReader,
     IUpdateFinder updateFinder,
     IPackageUpdateSetSort sorter,
     ILocalUpdater updater,
     IReporter reporter,
     INuKeeperLogger logger)
 {
     _nuGetSourcesReader = nuGetSourcesReader;
     _updateFinder       = updateFinder;
     _sorter             = sorter;
     _updater            = updater;
     _reporter           = reporter;
     _logger             = logger;
 }
Exemple #5
0
 public RepositoryUpdater(
     INuGetSourcesReader nugetSourcesReader,
     IUpdateFinder updateFinder,
     IPackageUpdateSelection updateSelection,
     IPackageUpdater packageUpdater,
     INuKeeperLogger logger,
     SolutionsRestore solutionsRestore,
     IReporter reporter)
 {
     _nugetSourcesReader = nugetSourcesReader;
     _updateFinder       = updateFinder;
     _updateSelection    = updateSelection;
     _packageUpdater     = packageUpdater;
     _logger             = logger;
     _solutionsRestore   = solutionsRestore;
     _reporter           = reporter;
 }
Exemple #6
0
 public RepositoryUpdater(
     IUpdateFinder updateFinder,
     IPackageUpdateSelection updateSelection,
     IPackageUpdater packageUpdater,
     INuKeeperLogger logger,
     SolutionsRestore solutionsRestore,
     IAvailableUpdatesReporter availableUpdatesReporter,
     UserSettings settings)
 {
     _updateFinder             = updateFinder;
     _updateSelection          = updateSelection;
     _packageUpdater           = packageUpdater;
     _logger                   = logger;
     _solutionsRestore         = solutionsRestore;
     _availableUpdatesReporter = availableUpdatesReporter;
     _settings                 = settings;
 }
        public void Initialize()
        {
            _packagesToReturn = new List <PackageUpdateSet>();

            _sourcesReader  = Substitute.For <INuGetSourcesReader>();
            _nukeeperLogger = Substitute.For <INuKeeperLogger>();
            _updateFinder   = Substitute.For <IUpdateFinder>();
            _packageUpdater = Substitute.For <IPackageUpdater>();
            _updateFinder
            .FindPackageUpdateSets(
                Arg.Any <IFolder>(),
                Arg.Any <NuGetSources>(),
                Arg.Any <VersionChange>(),
                Arg.Any <UsePrerelease>(),
                Arg.Any <Regex>()
                )
            .Returns(_packagesToReturn);
        }