void CreateSolution()
 {
     fakePackageManagementEvents = new FakePackageManagementEvents();
     fakeProject         = new FakePackageManagementProject();
     action              = new UpdatePackageAction(fakeProject, fakePackageManagementEvents);
     updatePackageHelper = new UpdatePackageHelper(action);
 }
Ejemplo n.º 2
0
        void UpdatePackageInSingleProject()
        {
            IPackageManagementProject project = GetProject();
            UpdatePackageAction       action  = CreateUpdatePackageAction(project);

            action.Execute();
        }
Ejemplo n.º 3
0
 public void UpdatePackage(IPackage package, UpdatePackageAction updateAction)
 {
     PackagePassedToUpdatePackage                  = package;
     PackageOperationsPassedToUpdatePackage        = updateAction.Operations;
     UpdateDependenciesPassedToUpdatePackage       = updateAction.UpdateDependencies;
     AllowPrereleaseVersionsPassedToInstallPackage = updateAction.AllowPrereleaseVersions;
 }
 void UpdatePackage(ProgressMonitorStatusMessage progressMessage, UpdatePackageAction action)
 {
     try {
         PackageManagementServices.BackgroundPackageActionRunner.Run(progressMessage, action);
     } catch (Exception ex) {
         PackageManagementServices.BackgroundPackageActionRunner.ShowError(progressMessage, ex);
     }
 }
 void CreateSolution()
 {
     packageManagementEvents = new PackageManagementEvents();
     fakeProject             = new FakePackageManagementProject();
     fileRemover             = new FakeFileRemover();
     action = new UpdatePackageAction(fakeProject, packageManagementEvents, fileRemover);
     updatePackageHelper = new UpdatePackageHelper(action);
 }
        void UpdatePackageInSingleProject()
        {
            IPackageManagementProject project = GetProject();
            UpdatePackageAction       action  = CreateUpdatePackageAction(project);

            using (IDisposable operation = StartUpdateOperation(action)) {
                action.Execute();
            }
        }
        public void CreateActions_OnePackageInProject_ActionCreatedFromProject()
        {
            CreateUpdateAllPackagesInProject();
            AddPackageToProject("Test");
            CallCreateActions();

            UpdatePackageAction action         = updateActions [0];
            UpdatePackageAction expectedAction = fakeProject.FirstFakeUpdatePackageActionCreated;

            Assert.AreEqual(expectedAction, action);
        }
Ejemplo n.º 8
0
        UpdatePackageAction CreateUpdatePackageAction(IPackageManagementProject project)
        {
            UpdatePackageAction action = project.CreateUpdatePackageAction();

            action.PackageId               = Id;
            action.PackageVersion          = Version;
            action.UpdateDependencies      = UpdateDependencies;
            action.AllowPrereleaseVersions = AllowPreleaseVersions;
            action.PackageScriptRunner     = this;
            return(action);
        }
        public void CreateActions_SolutionHasOneProject_UpdateActionCreatedFromProject()
        {
            CreateUpdatePackageInAllProjects();
            AddProjectToSolution("MyProject");
            CallCreateActions();

            UpdatePackageAction action         = FirstUpdateAction;
            UpdatePackageAction expectedAction = FirstProjectInSolution.FirstFakeUpdatePackageActionCreated;

            Assert.AreEqual(expectedAction, action);
        }
        public void UpdatePackage()
        {
            var packageReferenceNode = (PackageReferenceNode)CurrentNode.DataItem;
            ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateUpdatingSinglePackageMessage(packageReferenceNode.Id);

            try {
                IPackageManagementProject project = PackageManagementServices.Solution.GetActiveProject();
                UpdatePackageAction       action  = project.CreateUpdatePackageAction();
                action.PackageId = packageReferenceNode.Id;

                PackageManagementServices.BackgroundPackageActionRunner.Run(progressMessage, action);
            } catch (Exception ex) {
                PackageManagementServices.BackgroundPackageActionRunner.ShowError(progressMessage, ex);
            }
        }
        public void CreateActions_OnePackageInSolutionWithTwoProjects_ReturnsTwoActionsCreatedFromProjects()
        {
            CreateUpdatePackageInAllProjects();
            FakePackageManagementProject project1 = AddProjectToSolution("MyProject1");
            FakePackageManagementProject project2 = AddProjectToSolution("MyProject2");

            CallCreateActions();

            var expectedActions = new UpdatePackageAction[] {
                project1.FirstFakeUpdatePackageActionCreated,
                project2.FirstFakeUpdatePackageActionCreated
            };

            Assert.AreEqual(expectedActions, updateActions);
        }
        public void UpdatePackage()
        {
            var packageReferenceNode = (PackageReferenceNode)CurrentNode.DataItem;

            try {
                IPackageManagementProject    project         = PackageManagementServices.Solution.GetActiveProject();
                ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateUpdatingSinglePackageMessage(packageReferenceNode.Id, project);
                UpdatePackageAction          action          = project.CreateUpdatePackageAction();
                action.PackageId = packageReferenceNode.Id;
                action.AllowPrereleaseVersions = !packageReferenceNode.IsReleaseVersion();

                RestoreBeforeUpdateAction.Restore(project, () => {
                    UpdatePackage(progressMessage, action);
                });
            } catch (Exception ex) {
                ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateUpdatingSinglePackageMessage(packageReferenceNode.Id);
                PackageManagementServices.BackgroundPackageActionRunner.ShowError(progressMessage, ex);
            }
        }
Ejemplo n.º 13
0
		IDisposable StartUpdateOperation(UpdatePackageAction action)
		{
			return action.Project.SourceRepository.StartUpdateOperation(action.PackageId);
		}
		void UpdatePackage (ProgressMonitorStatusMessage progressMessage, UpdatePackageAction action)
		{
			try {
				PackageManagementServices.BackgroundPackageActionRunner.Run (progressMessage, action);
			} catch (Exception ex) {
				PackageManagementServices.BackgroundPackageActionRunner.ShowError (progressMessage, ex);
			}
		}
Ejemplo n.º 15
0
 public void UpdatePackage(IPackage package, UpdatePackageAction updateAction)
 {
     UpdatePackageAction(package, updateAction);
 }
 public UpdatePackageHelper(UpdatePackageAction action)
 {
     this.action = action;
 }
Ejemplo n.º 17
0
 IDisposable StartUpdateOperation(UpdatePackageAction action)
 {
     return(action.Project.SourceRepository.StartUpdateOperation(action.PackageId));
 }
Ejemplo n.º 18
0
		public void UpdatePackage(IPackage package, UpdatePackageAction updateAction)
		{
			packageManager.UpdatePackage(package, updateAction);
		}
		public void UpdatePackage(IPackage package, UpdatePackageAction updateAction)
		{
			RunPackageOperations(updateAction.Operations);
			UpdatePackageReference(package, updateAction);
		}