Example #1
0
        public void Execute_UpdatePackagesAction_PackagesUpdatedUsingProject()
        {
            CreateAction();

            action.Execute();

            project.AssertWasCalled(p => p.UpdatePackages(action));
        }
        public void Execute_OneProjectThatHasOlderVersionsOfTwoPackagesBeingUpdated_PackageReferenceUpdatedInProjectForBothPackages()
        {
            CreateAction();
            IPackageFromRepository    package1 = AddPackageToAction("A", "1.0");
            IPackageFromRepository    package2 = AddPackageToAction("B", "1.0");
            IPackageManagementProject project  = AddProjectToSolution();

            ProjectHasOlderVersionOfPackage(project, package1);
            ProjectHasOlderVersionOfPackage(project, package2);

            action.Execute();

            project.AssertWasCalled(p => p.UpdatePackageReference(package1, action));
            project.AssertWasCalled(p => p.UpdatePackageReference(package2, action));
        }
        public void Execute_OneProjectThatHasOlderVersionOfPackageBeingUpdated_PackageReferenceUpdatedInProject()
        {
            CreateAction();
            IPackageFromRepository    package = AddPackageToAction("Test", "1.0");
            IPackageManagementProject project = AddProjectToSolution();

            ProjectHasOlderVersionOfPackage(project, package);

            action.Execute();

            project.AssertWasCalled(p => p.UpdatePackageReference(package, action));
        }
        public void Execute_OneProjectThatHasOlderVersionOfPackageBeingUpdated_PackageOperationsAreRun()
        {
            PackageOperation operation = CreateInstallOperationWithFile(@"tools\readme.txt");

            CreateActionWithOperations(operation);
            IPackageFromRepository    package = AddPackageToAction("Test", "1.0");
            IPackageManagementProject project = AddProjectToSolution();
            var expectedOperations            = new PackageOperation[] { operation };

            action.Execute();

            project.AssertWasCalled(p => p.RunPackageOperations(expectedOperations));
        }
        public void Execute_TwoProjectsAndOnlyOneHasOlderVersionsOfPackageBeingUpdated_PackageReferenceUpdatedInOnlyOneProject()
        {
            CreateAction();
            IPackageFromRepository    package  = AddPackageToAction("A", "1.0");
            IPackageManagementProject project1 = AddProjectToSolution();
            IPackageManagementProject project2 = AddProjectToSolution();

            ProjectHasOlderVersionOfPackage(project2, package);

            action.Execute();

            project1.AssertWasNotCalled(p => p.UpdatePackageReference(package, action));
            project2.AssertWasCalled(p => p.UpdatePackageReference(package, action));
        }