Inheritance: IPackageManagementSolution
		void CreateSolution ()
		{
			packageManagerFactory = new FakePackageManagerFactory ();
			packageRepositoryCache = new FakePackageRepositoryFactory ();
			packageEvents = new PackageManagementEvents ();
			solution = new FakePackageManagementSolution ();
		}
		void CreateReinstaller ()
		{
			solution = new FakePackageManagementSolution ();
			project = solution.FakeActiveProject;
			backgroundRunner = new FakeBackgroundPackageActionRunner ();

			reinstaller = new PackageReinstaller (solution, backgroundRunner);
		}
		void CreateCommandLineWithSolution (string fileName, MonoRuntimeInfo monoRuntimeInfo, bool isMonoRuntime)
		{
			var solution = new FakePackageManagementSolution ();
			solution.FileName = fileName;
			commandLine = new NuGetPackageRestoreCommandLine (
				solution,
				monoRuntimeInfo,
				isMonoRuntime);
		}
		void CreateViewModel (FakePackageManagementSolution solution)
		{
			viewModelParent = CreateViewModelParent ();
			viewModel = new TestablePackageViewModel (viewModelParent, solution);
			fakePackage = viewModel.FakePackage;
			this.fakeSolution = solution;
			packageManagementEvents = viewModel.PackageManagementEvents;
			fakeLogger = viewModel.FakeLogger;
			fakeUninstallPackageAction = solution.FakeProjectToReturnFromGetProject.FakeUninstallPackageAction;
		}
		void CreateUpdatedPackagesInSolution ()
		{
			solution = new FakePackageManagementSolution ();
			registeredPackageRepositories = new FakeRegisteredPackageRepositories ();
			packageManagementEvents = new PackageManagementEvents ();
			updatedPackagesInSolution = new TestableUpdatedPackagesInSolution (
				solution,
				registeredPackageRepositories,
				packageManagementEvents);
		}
 public TestablePackageViewModel(
     IPackageViewModelParent parent,
     FakePackageManagementSolution solution)
     : this(
         parent,
         new FakePackage("Test"),
         new PackageManagementSelectedProjects(solution),
         new PackageManagementEvents(),
         new FakeLogger())
 {
     this.FakeSolution = solution;
 }
		public TestablePackageViewModel (
			IPackageViewModelParent parent,
			FakePackageManagementSolution solution)
			: this (
				parent,
				new FakePackage ("Test"),
				new PackageManagementSelectedProjects (solution),
				new PackageManagementEvents (),
				new FakeLogger ())
		{
			this.FakeSolution = solution;
		}
		AvailablePackagesViewModel CreateViewModelParent (FakePackageManagementSolution solution)
		{
			var taskFactory = new FakeTaskFactory ();
			var registeredPackageRepositories = new FakeRegisteredPackageRepositories ();
			var packageViewModelFactory = new FakePackageViewModelFactory ();
			var recentPackageRepository = new FakeRecentPackageRepository ();

			return new AvailablePackagesViewModel (
				solution,
				registeredPackageRepositories,
				recentPackageRepository,
				packageViewModelFactory,
				taskFactory);
		}
		void CreateViewModel (FakeRegisteredPackageRepositories registeredPackageRepositories)
		{
			taskFactory = new FakeTaskFactory ();
			var packageViewModelFactory = new FakePackageViewModelFactory ();
			recentPackageRepository = new FakeRecentPackageRepository ();
			solution = new FakePackageManagementSolution ();

			viewModel = new AvailablePackagesViewModel (
				solution,
				registeredPackageRepositories,
				recentPackageRepository,
				packageViewModelFactory,
				taskFactory);
		}
		void CreateUpdatedPackagesInSolution ()
		{
			solution = new FakePackageManagementSolution ();
			registeredPackageRepositories = new FakeRegisteredPackageRepositories ();
			packageManagementEvents = new PackageManagementEvents ();
			taskFactory = new FakeTaskFactory ();
			taskFactory.RunTasksSynchronously = true;
			progressMonitorFactory = new FakeProgressMonitorFactory ();
			checkForUpdatesTaskRunner = new TestableCheckForUpdatesTaskRunner (taskFactory);
			updatedPackagesInSolution = new TestableUpdatedPackagesInSolution (
				solution,
				registeredPackageRepositories,
				packageManagementEvents,
				checkForUpdatesTaskRunner);
		}
		void CreateRunner ()
		{
			project = new FakeDotNetProject (@"d:\projects\MyProject\MyProject.csproj");
			project.Name = "MyProject";
			project.TargetFrameworkMoniker = new TargetFrameworkMoniker ("4.5");
			solution = new FakePackageManagementSolution ();
			registeredRepositories = new FakeRegisteredPackageRepositories ();
			progressMonitorFactory = new FakeProgressMonitorFactory ();
			progressMonitor = progressMonitorFactory.ProgressMonitor;
			packageManagementEvents = new PackageManagementEvents ();

			repositoryFactoryEvents = new FakePackageRepositoryFactoryEvents ();
			progressProvider = new PackageManagementProgressProvider (repositoryFactoryEvents, handler => {
				handler.Invoke ();
			});

			runner = new TestablePackageCompatibilityRunner (
				project,
				solution,
				registeredRepositories,
				progressMonitorFactory,
				packageManagementEvents,
				progressProvider);
		}
示例#12
0
		void CreateFakeSolution ()
		{
			fakeSolution = new FakePackageManagementSolution ();
			fakeSolution.FakeActiveDotNetProject = ProjectHelper.CreateTestProject ();
		}
		void CreateUpdateAllPackagesInSolution ()
		{
			fakeSolution = new FakePackageManagementSolution ();
			fakeSourceRepository = new FakePackageRepository ();
			updateAllPackagesInSolution = new UpdateAllPackagesInSolution (fakeSolution, fakeSourceRepository);
		}
		void CreateSolution ()
		{
			solution = new FakePackageManagementSolution ();
		}
		PackageManagementSelectedProjects CreateSelectedProjects ()
		{
			var solution = new FakePackageManagementSolution ();
			return new PackageManagementSelectedProjects (solution);
		}