Ejemplo n.º 1
0
		public void ManagePackagesForSelectedProjects_FirstProjectSelectedAndExceptionThrownWhenCreatingInstallAction_ExceptionLogged()
		{
			CreateViewModel();
			CreateTwoFakeSelectedProjects();
			FirstFakeSelectedProject.IsSelected = true;
			var exceptionThrowingProject = new ExceptionThrowingPackageManagementProject();
			FirstFakeSelectedProject.FakeProject = exceptionThrowingProject;
			AddFakeInstallPackageOperationWithPackageThatDoesNotRequireLicenseAcceptance(FirstFakeSelectedProject);
			
			var exception = new Exception("Exception error message");
			exceptionThrowingProject.ExceptionToThrowWhenCreateInstallPackageActionCalled = exception;
			viewModel.ManagePackagesForSelectedProjects(fakeSelectedProjects);
			
			bool contains = fakeLogger.FormattedMessagesLoggedContainsText("Exception error message");
			
			Assert.IsTrue(contains);
		}
Ejemplo n.º 2
0
		void CreateViewModelWithExceptionThrowingProject()
		{
			CreateViewModel();
			exceptionThrowingProject = new ExceptionThrowingPackageManagementProject();
			viewModel.FakeSolution.FakeProjectToReturnFromGetProject = exceptionThrowingProject;
		}
Ejemplo n.º 3
0
		public void ManagePackagesForSelectedProjects_FirstProjectSelectedAndExceptionThrownWhenResolvingPackageOperations_ExceptionReported()
		{
			CreateViewModel();
			CreateTwoFakeSelectedProjects();
			FirstFakeSelectedProject.IsSelected = true;
			var exceptionThrowingProject = new ExceptionThrowingPackageManagementProject();
			FirstFakeSelectedProject.FakeProject = exceptionThrowingProject;
			AddFakeInstallPackageOperationWithPackageThatDoesNotRequireLicenseAcceptance(FirstFakeSelectedProject);
			
			var exception = new Exception("Test");
			exceptionThrowingProject.ExceptionToThrowWhenGetInstallPackageOperationsCalled = exception;
			viewModel.ManagePackagesForSelectedProjects(fakeSelectedProjects);
			
			Assert.AreEqual(exception, fakePackageManagementEvents.ExceptionPassedToOnPackageOperationError);
		}