Пример #1
0
        public async Task EmptyListCase()
        {
            var selection = Substitute.For <IUpdateSelection>();
            var runner    = Substitute.For <IUpdateRunner>();
            var logger    = Substitute.For <INuKeeperLogger>();
            var folder    = Substitute.For <IFolder>();
            var restorer  = new SolutionsRestore(Substitute.For <IFileRestoreCommand>());

            var updater = new LocalUpdater(selection, runner, restorer, logger);

            await updater.ApplyUpdates(new List <PackageUpdateSet>(),
                                       folder,
                                       NuGetSources.GlobalFeed, Settings());

            await runner.Received(0)
            .Update(Arg.Any <PackageUpdateSet>(), Arg.Any <NuGetSources>());
        }
Пример #2
0
        public async Task SingleItemCase()
        {
            var updates = PackageUpdates.MakeUpdateSet("foo")
                          .InList();

            var selection = Substitute.For <IUpdateSelection>();

            FilterIsPassThrough(selection);


            var runner   = Substitute.For <IUpdateRunner>();
            var logger   = Substitute.For <INuKeeperLogger>();
            var folder   = Substitute.For <IFolder>();
            var restorer = new SolutionsRestore(Substitute.For <IFileRestoreCommand>());

            var updater = new LocalUpdater(selection, runner, restorer, logger);

            await updater.ApplyUpdates(updates, folder, NuGetSources.GlobalFeed, Settings());

            await runner.Received(1)
            .Update(Arg.Any <PackageUpdateSet>(), Arg.Any <NuGetSources>());
        }