void CreateViewModel(
			FakePackageManagementSolution solution, 
			IThreadSafePackageManagementEvents packageManagementEvents)
		{
			fakeTaskFactory = new FakeTaskFactory();
			fakeLicenseAcceptanceService = new FakeLicenseAcceptanceService();
			fakeSelectProjectsService = new FakeSelectProjectsService();
			userPrompts = new ManagePackagesUserPrompts(
				packageManagementEvents,
				fakeLicenseAcceptanceService,
				fakeSelectProjectsService);
			fakeActionRunner = new FakePackageActionRunner();
			
			packagesViewModels = new PackagesViewModels(
				solution,
				fakeRegisteredPackageRepositories,
				packageManagementEvents,
				fakeActionRunner,
				fakeTaskFactory);
			
			viewTitle = new ManagePackagesViewTitle(solution);
			
			viewModel = new ManagePackagesViewModel(
				packagesViewModels,
				viewTitle,
				packageManagementEvents,
				userPrompts);
			fakeTaskFactory.ExecuteAllFakeTasks();
		}
		void CreateUpdatePackageInAllProjects(string packageId, SemanticVersion version)
		{
			fakeSolution = new FakePackageManagementSolution();
			fakeSourceRepository = new FakePackageRepository();
			var packageReference = new PackageReference(packageId, version, null, null, false, false);
			updatePackageInAllProjects = new UpdatePackageInAllProjects(packageReference, fakeSolution, fakeSourceRepository);
		}
		void CreateViewModel(FakePackageManagementSolution fakeSolution)
		{
			viewModel = new TestableUpdatedPackageViewModel(fakeSolution);
			fakeProject = fakeSolution.FakeProjectToReturnFromGetProject;
			fakeActionRunner = viewModel.FakeActionRunner;
			fakePackageManagementEvents = viewModel.FakePackageManagementEvents;
		}
		void CreateHost()
		{
			host = new TestablePackageManagementConsoleHost();
			fakeSolution = host.FakeSolution;
			scriptingConsole = host.FakeScriptingConsole;
			powerShellHost = host.FakePowerShellHostFactory.FakePowerShellHost;
			fakeRegisteredPackageRepositories = host.FakeRegisteredPackageRepositories;
		}
		void CreateViewModel()
		{
			viewModel = new TestableUpdatedPackageViewModel();
			fakeSolution = viewModel.FakeSolution;
			fakeProject = fakeSolution.FakeActiveProject;
			updatePackageAction = fakeProject.FakeUpdatePackageAction;
			fakeActionRunner = viewModel.FakeActionRunner;
		}
		void CreateViewModel()
		{
			viewModel = new TestableInstalledPackageViewModel();
			fakeSolution = viewModel.FakeSolution;
			fakeActionRunner = viewModel.FakeActionRunner;
			fakePackage = viewModel.FakePackage;
			fakePackageManagementEvents = viewModel.FakePackageManagementEvents;
		}
		void CreateViewModel(FakePackageManagementSolution fakeSolution)
		{
			viewModelParent = MockRepository.GenerateStub<IPackageViewModelParent>();
			viewModel = new TestableUpdatedPackageViewModel(viewModelParent, fakeSolution);
			fakeProject = fakeSolution.FakeProjectToReturnFromGetProject;
			fakeActionRunner = viewModel.FakeActionRunner;
			fakePackageManagementEvents = viewModel.FakePackageManagementEvents;
		}
Пример #8
0
		void CreateCmdlet()
		{
			cmdlet = new TestableGetProjectCmdlet();
			fakeTerminatingError = cmdlet.FakeCmdletTerminatingError;
			fakeCommandRuntime = cmdlet.FakeCommandRuntime;
			fakeConsoleHost = cmdlet.FakePackageManagementConsoleHost;
			fakeSolution = cmdlet.FakeSolution;
			defaultProject = base.AddDefaultProjectToConsoleHost();
		}
		void CreateViewModel()
		{
			IPackageViewModelParent parent = MockRepository.GenerateStub<IPackageViewModelParent>();
			viewModel = new TestableInstalledPackageViewModel(parent);
			fakeSolution = viewModel.FakeSolution;
			fakeActionRunner = viewModel.FakeActionRunner;
			fakePackage = viewModel.FakePackage;
			fakePackageManagementEvents = viewModel.FakePackageManagementEvents;
		}
		public TestablePackageViewModel(FakePackageManagementSolution solution)
			: this(
				new FakePackage(),
				solution,
				new FakePackageManagementEvents(),
				new FakePackageActionRunner(),
				new FakeLogger())
		{
		}
		void CreateProvider()
		{
			fakeSolution = new FakePackageManagementSolution();
			fakeRegisteredRepositories = new FakeRegisteredPackageRepositories();
			fakePowerShellDetection = new FakePowerShellDetection();
			provider = new PackageManagementConsoleHostProvider(
				fakeSolution,
				fakeRegisteredRepositories,
				fakePowerShellDetection);
		}
Пример #12
0
		public TestablePackageViewModel(FakePackageManagementSolution solution)
			: this(
				new FakePackage("Test"),
				new PackageManagementSelectedProjects(solution),
				new FakePackageManagementEvents(),
				new FakePackageActionRunner(),
				new FakeLogger())
		{
			this.FakeSolution = solution;
		}
Пример #13
0
		void CreateViewModel(FakePackageManagementSolution solution)
		{
			viewModelParent = MockRepository.GenerateStub<IPackageViewModelParent>();
			viewModel = new TestablePackageViewModel(viewModelParent, solution);
			fakePackage = viewModel.FakePackage;
			this.fakeSolution = solution;
			fakePackageManagementEvents = viewModel.FakePackageManagementEvents;
			fakeLogger = viewModel.FakeLogger;
			fakeUninstallPackageAction = solution.FakeProjectToReturnFromGetProject.FakeUninstallPackageAction;
			fakeActionRunner = viewModel.FakeActionRunner;
		}
Пример #14
0
 public DesignTimePackagesViewModel(
     DesignTimeRegisteredPackageRepositories registeredPackageRepositories,
     FakePackageManagementSolution solution)
     : base(
         registeredPackageRepositories,
         new PackageViewModelFactory(solution, null, null),
         new PackageManagementTaskFactory())
 {
     PageSize = 3;
     AddPackageViewModels();
 }
		public TestableInstalledPackageViewModel(FakePackageManagementSolution solution)
			: this(
				new FakePackage(),
				new SelectedProjectsForInstalledPackages(solution),
				new FakePackageManagementEvents(),
				new FakePackageActionRunner(),
				new FakeLogger())
		{
			this.FakeSolution = solution;
			solution.FakeActiveMSBuildProject = ProjectHelper.CreateTestProject("MyProject");
		}
		public DesignTimePackagesViewModel(
			DesignTimeRegisteredPackageRepositories registeredPackageRepositories,
			FakePackageManagementSolution solution)
			: base(
				registeredPackageRepositories,
				new PackageViewModelFactory(solution, null, null),
				new PackageManagementTaskFactory())
		{
			PageSize = 3;
			AddPackageViewModels();
		}
		void CreateViewModel(
			FakePackageManagementSolution solution,
			FakeRegisteredPackageRepositories registeredPackageRepositories,
			FakePackageActionRunner actionRunner)
		{
			packageViewModelFactory = new FakePackageViewModelFactory {
				FakeSolution = solution,
				FakeActionRunner = actionRunner
			};
			CreateViewModel(solution, registeredPackageRepositories, packageViewModelFactory);
		}
		void CreateViewModel(FakePackageManagementSolution solution)
		{
			taskFactory = new FakeTaskFactory();
			registeredPackageRepositories = new FakeRegisteredPackageRepositories();
			var packageViewModelFactory = new FakePackageViewModelFactory();
			viewModel = new UpdatedPackagesViewModel(
				solution,
				registeredPackageRepositories,
				packageViewModelFactory,
				taskFactory);
		}
Пример #19
0
		void CreateViewModel(FakePackageManagementSolution solution)
		{
			viewModel = new TestablePackageViewModel(solution);
			fakePackage = viewModel.FakePackage;
			this.fakeSolution = solution;
			fakePackageManagementEvents = viewModel.FakePackageManagementEvents;
			fakeLogger = viewModel.FakeLogger;
			fakeInstallPackageAction = solution.FakeProjectToReturnFromGetProject.FakeInstallPackageAction;
			fakeUninstallPackageAction = solution.FakeProjectToReturnFromGetProject.FakeUninstallPackageAction;
			fakeActionRunner = viewModel.FakeActionRunner;
		}
Пример #20
0
		void CreateCmdlet()
		{
			cmdlet = new TestableGetPackageCmdlet();
			fakeSolution = new FakePackageManagementSolution();
			fakeRegisteredPackageRepositories = cmdlet.FakeRegisteredPackageRepositories;
			fakeConsoleHost = cmdlet.FakePackageManagementConsoleHost;
			fakeConsoleHost.FakeProject = fakeSolution.FakeActiveProject;
			fakeCommandRuntime = cmdlet.FakeCommandRuntime;
			fakeTerminatingError = cmdlet.FakeCmdletTerminatingError;
			
			AddDefaultProjectToConsoleHost();
		}
		void CreateCmdletWithoutActiveProject()
		{
			cmdlet = new TestableUpdatePackageCmdlet();
			fakeTerminatingError = cmdlet.FakeCmdletTerminatingError;
			fakeConsoleHost = cmdlet.FakePackageManagementConsoleHost;
			fakeSolution = fakeConsoleHost.FakeSolution;
			fakeProject = fakeConsoleHost.FakeProject;
			fakeUpdateActionsFactory = cmdlet.FakeUpdatePackageActionsFactory;
			fakeUpdateAllPackagesInProject = fakeUpdateActionsFactory.FakeUpdateAllPackagesInProject;
			fakeUpdateAllPackagesInSolution = fakeUpdateActionsFactory.FakeUpdateAllPackagesInSolution;
			fakeUpdatePackageInAllProjects = fakeUpdateActionsFactory.FakeUpdatePackageInAllProjects;
		}
        public TestableUpdatedPackageViewModel(
			IPackageViewModelParent parent,
			FakePackageManagementSolution solution)
            : this(parent,
				new FakePackage(),
				new SelectedProjectsForUpdatedPackages(solution),
				new FakePackageManagementEvents(),
				new FakePackageActionRunner(),
				new FakeLogger())
        {
            this.FakeSolution = solution;
        }
        public TestableGetProjectCmdlet(
			FakePackageManagementConsoleHost consoleHost,
			FakeCommandRuntime commandRuntime,
			FakeCmdletTerminatingError cmdletTerminatingError)
            : base(consoleHost, cmdletTerminatingError)
        {
            this.FakePackageManagementConsoleHost = consoleHost;
            this.FakeCommandRuntime = commandRuntime;
            this.CommandRuntime = commandRuntime;
            this.FakeCmdletTerminatingError = cmdletTerminatingError;
            this.FakeSolution = consoleHost.FakeSolution;
        }
		void CreateViewModel(FakePackageManagementSolution solution, IThreadSafePackageManagementEvents packageManagementEvents)
		{
			taskFactory = new FakeTaskFactory();
			fakeLicenseAcceptanceSevice = new FakeLicenseAcceptanceService();
			fakeActionRunner = new FakePackageActionRunner();
			viewModel = new ManagePackagesViewModel(
				solution,
				fakeRegisteredPackageRepositories,
				packageManagementEvents,
				fakeActionRunner,
				fakeLicenseAcceptanceSevice,
				taskFactory);
			taskFactory.ExecuteAllFakeTasks();
		}
		void CreateViewModel(FakePackageManagementSolution solution)
		{
			registeredPackageRepositories = new FakeRegisteredPackageRepositories();
			var packageViewModelFactory = new FakePackageViewModelFactory();
			taskFactory = new FakeTaskFactory();
			packageManagementEvents = new PackageManagementEvents();
			
			viewModel = new InstalledPackagesViewModel(
				solution,
				packageManagementEvents,
				registeredPackageRepositories,
				packageViewModelFactory,
				taskFactory);
		}
		public TestablePackageManagementConsoleHost(
			FakePackageManagementSolution solution,
			FakeRegisteredPackageRepositories registeredPackageRepositories,
			FakeScriptingConsoleWithLinesToRead scriptingConsole,
			FakePowerShellHostFactory powerShellHostFactory,
			FakePackageManagementAddInPath addinPath)
			: base(solution, registeredPackageRepositories, null, powerShellHostFactory, addinPath)
		{
			this.FakeSolution = solution;
			this.FakeScriptingConsole = scriptingConsole;
			this.ScriptingConsole = scriptingConsole;
			this.FakePowerShellHostFactory = powerShellHostFactory;
			this.FakeRegisteredPackageRepositories = registeredPackageRepositories;
			this.FakePackageManagementAddInPath = addinPath;
		}
		public TestableUpdatedPackageViewModel(
			FakePackage package,
			FakePackageManagementSolution solution,
			FakePackageManagementEvents packageManagementEvents,
			FakePackageActionRunner actionRunner,
			FakeLogger logger)
			: base(
				package,
				solution,
				packageManagementEvents,
				actionRunner,
				logger)
		{
			this.FakePackage = package;
			this.FakeSolution = solution;
			this.FakeActionRunner = actionRunner;
			this.FakeLogger = logger;
		}
		void CreateSolution()
		{
			solution = new FakePackageManagementSolution();
		}
		void CreateFakeSolution()
		{
			fakeSolution = new FakePackageManagementSolution();
			fakeSolution.FakeActiveMSBuildProject = ProjectHelper.CreateTestProject("MyProject");
		}
		void CreateSolution()
		{
			solution = new FakePackageManagementSolution();
			registeredPackageRepositories = new FakeRegisteredPackageRepositories();
		}
		void CreateUpdateAllPackagesInSolution()
		{
			fakeSolution = new FakePackageManagementSolution();
			fakeSourceRepository = new FakePackageRepository();
			updateAllPackagesInSolution = new UpdateAllPackagesInSolution(fakeSolution, fakeSourceRepository);
		}