public void UpdatePackages_TwoPackageOperations_BothPackagesInOperationsAddedToSharedRepository() { CreatePackageManager(); CreateTestableProjectManager(); PackageOperation operation1 = CreateOneInstallPackageOperation("First", "1.0"); PackageOperation operation2 = CreateOneInstallPackageOperation("Second", "1.0"); UpdatePackagesAction action = CreateUpdatePackagesActionWithOperations(operation1, operation2); var expectedPackages = new FakePackage[] { operation1.Package as FakePackage, operation2.Package as FakePackage }; packageManager.UpdatePackages(action); PackageCollectionAssert.AreEqual(expectedPackages, fakeSolutionSharedRepository.PackagesAdded); }
public void GetUpdatePackageOperations_PackageOperationResolverFactoryUsed_PackageManagerUsesLocalRepositoryWhenGettingPackageOperations() { CreatePackageManager(); FakePackage package = CreateFakePackage("Test", "1.1"); UpdatePackagesAction updateAction = CreateUpdatePackagesActionWithPackages(package); CreateFakePackageResolverForUpdatePackageOperations(); AddInstallOperationForPackage(package); packageManager.GetUpdatePackageOperations(updateAction.Packages, updateAction); IPackageRepository expectedRepository = packageManager.LocalRepository; IPackageRepository actualRepository = fakePackageOperationResolverFactory.LocalRepositoryPassedToCreateUpdatePackageOperationsResolver; Assert.AreEqual(expectedRepository, actualRepository); }
public void GetUpdatePackageOperations_TwoPackages_ReturnsPackageOperationsForBothPackages() { CreatePackageManager(); CreateFakePackageResolverForUpdatePackageOperations(); IPackageFromRepository package1 = CreateFakePackage("Test", "1.0"); IPackageFromRepository package2 = CreateFakePackage("Test2", "1.0"); PackageOperation operation1 = AddInstallOperationForPackage(package1); PackageOperation operation2 = AddInstallOperationForPackage(package2); UpdatePackagesAction updateAction = CreateUpdatePackagesActionWithPackages(package1, package2); List <PackageOperation> operations = packageManager.GetUpdatePackageOperations(updateAction.Packages, updateAction).ToList(); Assert.AreEqual(2, operations.Count()); Assert.IsTrue(operations.Contains(operation1)); Assert.IsTrue(operations.Contains(operation2)); }
public void UpdateAllPackagesCommand_TwoPackagesToBeUpdated_BothPackagesUpdated() { CreateViewModel(); AddPackageToLocalRepository("First", "1.0.0.0"); FakePackage firstUpdatedPackage = AddPackageToActiveRepository("First", "1.1.0.0"); AddPackageToLocalRepository("Second", "1.0.0.0"); FakePackage secondUpdatedPackage = AddPackageToActiveRepository("Second", "1.1.0.0"); viewModel.ReadPackages(); CompleteReadPackagesTask(); RunUpdateAllPackagesCommand(); UpdatePackagesAction action = GetUpdatePackagesActionRun(); IPackage firstPackage = action.Packages.FirstOrDefault(p => p.Id == "First"); IPackage secondPackage = action.Packages.FirstOrDefault(p => p.Id == "Second"); Assert.AreEqual(firstUpdatedPackage, firstPackage); Assert.AreEqual(secondUpdatedPackage, secondPackage); Assert.AreEqual(2, action.Packages.Count()); }
public void UpdatePackages(UpdatePackagesAction updateAction) { packageManager.UpdatePackages(updateAction); }
public void UpdatePackages(UpdatePackagesAction action) { }
public void UpdatePackages(UpdatePackagesAction updateAction) { UpdatePackagesActionsPassedToUpdatePackages = updateAction; }
void CreateUpdatePackagesAction() { updatePackagesAction = new UpdatePackagesAction(project, null); }
public void UpdatePackages(UpdatePackagesAction updateAction) { RunPackageOperations(updateAction.Operations); foreach (IPackage package in updateAction.Packages) { UpdatePackageReference(package, updateAction); } }