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>()); }
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>()); }