public void ProcessRecord_UpdateAllPackagesIsSolutionAndTwoUpdateActionsAndSourceRepositoryIsOperationAware_UpdateOperationStartedAndDisposedForSecondPackage()
		{
			CreateCmdletWithoutActiveProject();
			AddDefaultProjectToConsoleHost();
			AddPackageSourceToConsoleHost();
			CreateUpdateActionWhenUpdatingAllPackagesInSolution("Test1");
			FakeUpdatePackageAction action = CreateUpdateActionWhenUpdatingAllPackagesInSolution("Test2");
			var operationAwareRepository = new FakeOperationAwarePackageRepository();
			action.FakeProject.FakeSourceRepository = operationAwareRepository;
			
			RunCmdlet();
			
			operationAwareRepository.AssertOperationWasStartedAndDisposed(RepositoryOperationNames.Update, "Test2");
		}
		public void AddPackage_PackageRepositoryIsOperationAwareAndPackageAddedSuccessfully_UpdateOperationStartedForPackage()
		{
			CreateViewModel();
			var operationAwareRepository = new FakeOperationAwarePackageRepository();
			FakePackage fakePackage = viewModel.FakePackage;
			fakePackage.FakePackageRepository = operationAwareRepository;
			fakePackage.Id = "MyPackage";
			
			viewModel.AddPackage();
			
			operationAwareRepository.AssertOperationWasStartedAndDisposed(RepositoryOperationNames.Update, "MyPackage");
		}
		public void ProcessRecord_PackageIdAndProjectNameSpecifiedSpecifiedAndSourceRepositoryIsOperationAware_UpdateOperationStartedAndDisposedForPackage()
		{
			CreateCmdletWithActivePackageSourceAndProject();
			SetProjectNameParameter("TestProject");
			SetIdParameter("Test");
			var operationAwareRepository = new FakeOperationAwarePackageRepository();
			fakeProject.FakeSourceRepository = operationAwareRepository;
			
			RunCmdlet();
			
			operationAwareRepository.AssertOperationWasStartedAndDisposed(RepositoryOperationNames.Update, "Test");
		}
		public void ProcessRecord_PackageIdSpecifiedAndSourceRepositoryIsOperationAware_UpdateOperationStartedAndDisposedForPackage()
		{
			CreateCmdletWithoutActiveProject();
			AddDefaultProjectToConsoleHost();
			AddPackageSourceToConsoleHost();
			SetIdParameter("Test");
			FakeUpdatePackageAction action = CreateUpdateActionWhenUpdatingPackageInAllProjects("Test");
			var operationAwareRepository = new FakeOperationAwarePackageRepository();
			action.FakeProject.FakeSourceRepository = operationAwareRepository;
			
			RunCmdlet();
			
			operationAwareRepository.AssertOperationWasStartedAndDisposed(RepositoryOperationNames.Update, "Test");
		}
        public void ProcessRecord_SourceRepositoryIsOperationAware_InstallOperationStartedForPackageAndDisposed()
        {
            CreateCmdletWithoutActiveProject();
            AddDefaultProjectToConsoleHost();
            var operationAwareRepository = new FakeOperationAwarePackageRepository();
            fakeConsoleHost.FakeProject.FakeSourceRepository = operationAwareRepository;
            AddPackageSourceToConsoleHost();
            SetIdParameter("Test");

            RunCmdlet();

            operationAwareRepository.AssertOperationWasStartedAndDisposed(RepositoryOperationNames.Install, "Test");
        }
		public void UpdateAllPackagesCommand_SourceRepositoryIsOperationAware_UpdateOperationStartedAndDisposed()
		{
			CreateViewModel();
			var operationAwareRepository = new FakeOperationAwarePackageRepository();
			registeredPackageRepositories.FakeActiveRepository = operationAwareRepository;
			AddPackageToLocalRepository("Test", "1.0.0.0");
			AddPackageToActiveRepository("Test", "1.0.0.0");
			FakePackage newerPackage = AddPackageToActiveRepository("Test", "1.1.0.0");
			viewModel.ReadPackages();
			CompleteReadPackagesTask();
			
			RunUpdateAllPackagesCommand();
			
			operationAwareRepository.AssertOperationWasStartedAndDisposed(RepositoryOperationNames.Update, null);
		}
        public void ProcessRecord_ReinstallWhenPackageIdAndProjectNameSpecifiedAndSourceRepositoryIsOperationAware_ReinstallOperationStartedAndDisposedForPackage()
        {
            CreateCmdletWithActivePackageSourceAndProject();
            SetIdParameter("Test");
            SetProjectNameParameter("MyProject");
            fakeProject.FakeLocalRepository.AddFakePackage("Test");
            var operationAwareRepository = new FakeOperationAwarePackageRepository();
            fakeProject.FakeSourceRepository = operationAwareRepository;
            cmdlet.Reinstall = true;

            RunCmdlet();

            operationAwareRepository.AssertOperationWasStartedAndDisposed(RepositoryOperationNames.Reinstall, "Test");
        }
Exemplo n.º 8
0
		public void ManagePackage_TwoProjectsNeitherSelectedAndSourceRepositoryIsOperationAware_InstallOperationStarted()
		{
			CreateViewModelWithTwoProjectsSelected("Project A", "Project B");
			UserAcceptsProjectSelection();
			var operationAwareRepository = new FakeOperationAwarePackageRepository();
			fakePackage.FakePackageRepository = operationAwareRepository;
			fakePackage.Id = "MyPackage";
			
			viewModel.ManagePackage();
			
			operationAwareRepository.AssertOperationWasStartedAndDisposed(RepositoryOperationNames.Install, "MyPackage");
		}
Exemplo n.º 9
0
		public void AddPackage_PackageRepositoryIsOperationAwareAndExceptionThrownWhenCreatingInstallPackageAction_InstallOperationStartedForPackageBeforeInstallPackageActionCreatedAndPackageOperationsRequested()
		{
			CreateViewModelWithExceptionThrowingProject();
			var operationAwareRepository = new FakeOperationAwarePackageRepository();
			fakePackage.FakePackageRepository = operationAwareRepository;
			fakePackage.Id = "MyPackage";
			Exception ex = new Exception("Test");
			exceptionThrowingProject.ExceptionToThrowWhenCreateInstallPackageActionCalled = ex;
		
			viewModel.AddPackage();
			
			operationAwareRepository.AssertOperationWasStartedAndDisposed(RepositoryOperationNames.Install, "MyPackage");
		}