コード例 #1
0
		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();
		}
コード例 #2
0
		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);
		}
コード例 #3
0
		void CreateViewModel(FakePackageManagementSolution fakeSolution)
		{
			viewModel = new TestableUpdatedPackageViewModel(fakeSolution);
			fakeProject = fakeSolution.FakeProjectToReturnFromGetProject;
			fakeActionRunner = viewModel.FakeActionRunner;
			fakePackageManagementEvents = viewModel.FakePackageManagementEvents;
		}
コード例 #4
0
		void CreateHost()
		{
			host = new TestablePackageManagementConsoleHost();
			fakeSolution = host.FakeSolution;
			scriptingConsole = host.FakeScriptingConsole;
			powerShellHost = host.FakePowerShellHostFactory.FakePowerShellHost;
			fakeRegisteredPackageRepositories = host.FakeRegisteredPackageRepositories;
		}
コード例 #5
0
		void CreateViewModel()
		{
			viewModel = new TestableUpdatedPackageViewModel();
			fakeSolution = viewModel.FakeSolution;
			fakeProject = fakeSolution.FakeActiveProject;
			updatePackageAction = fakeProject.FakeUpdatePackageAction;
			fakeActionRunner = viewModel.FakeActionRunner;
		}
コード例 #6
0
		void CreateViewModel()
		{
			viewModel = new TestableInstalledPackageViewModel();
			fakeSolution = viewModel.FakeSolution;
			fakeActionRunner = viewModel.FakeActionRunner;
			fakePackage = viewModel.FakePackage;
			fakePackageManagementEvents = viewModel.FakePackageManagementEvents;
		}
コード例 #7
0
		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();
		}
コード例 #9
0
		void CreateViewModel()
		{
			IPackageViewModelParent parent = MockRepository.GenerateStub<IPackageViewModelParent>();
			viewModel = new TestableInstalledPackageViewModel(parent);
			fakeSolution = viewModel.FakeSolution;
			fakeActionRunner = viewModel.FakeActionRunner;
			fakePackage = viewModel.FakePackage;
			fakePackageManagementEvents = viewModel.FakePackageManagementEvents;
		}
コード例 #10
0
		public TestablePackageViewModel(FakePackageManagementSolution solution)
			: this(
				new FakePackage(),
				solution,
				new FakePackageManagementEvents(),
				new FakePackageActionRunner(),
				new FakeLogger())
		{
		}
コード例 #11
0
		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();
 }
コード例 #15
0
		public TestableInstalledPackageViewModel(FakePackageManagementSolution solution)
			: this(
				new FakePackage(),
				new SelectedProjectsForInstalledPackages(solution),
				new FakePackageManagementEvents(),
				new FakePackageActionRunner(),
				new FakeLogger())
		{
			this.FakeSolution = solution;
			solution.FakeActiveMSBuildProject = ProjectHelper.CreateTestProject("MyProject");
		}
コード例 #16
0
		public DesignTimePackagesViewModel(
			DesignTimeRegisteredPackageRepositories registeredPackageRepositories,
			FakePackageManagementSolution solution)
			: base(
				registeredPackageRepositories,
				new PackageViewModelFactory(solution, null, null),
				new PackageManagementTaskFactory())
		{
			PageSize = 3;
			AddPackageViewModels();
		}
コード例 #17
0
		void CreateViewModel(
			FakePackageManagementSolution solution,
			FakeRegisteredPackageRepositories registeredPackageRepositories,
			FakePackageActionRunner actionRunner)
		{
			packageViewModelFactory = new FakePackageViewModelFactory {
				FakeSolution = solution,
				FakeActionRunner = actionRunner
			};
			CreateViewModel(solution, registeredPackageRepositories, packageViewModelFactory);
		}
コード例 #18
0
		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();
		}
コード例 #21
0
		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;
		}
コード例 #22
0
        public TestableUpdatedPackageViewModel(
			IPackageViewModelParent parent,
			FakePackageManagementSolution solution)
            : this(parent,
				new FakePackage(),
				new SelectedProjectsForUpdatedPackages(solution),
				new FakePackageManagementEvents(),
				new FakePackageActionRunner(),
				new FakeLogger())
        {
            this.FakeSolution = solution;
        }
コード例 #23
0
        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;
        }
コード例 #24
0
		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();
		}
コード例 #25
0
		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);
		}
コード例 #26
0
		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;
		}
コード例 #27
0
		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;
		}
コード例 #28
0
		void CreateSolution()
		{
			solution = new FakePackageManagementSolution();
		}
コード例 #29
0
		void CreateFakeSolution()
		{
			fakeSolution = new FakePackageManagementSolution();
			fakeSolution.FakeActiveMSBuildProject = ProjectHelper.CreateTestProject("MyProject");
		}
コード例 #30
0
		void CreateSolution()
		{
			solution = new FakePackageManagementSolution();
			registeredPackageRepositories = new FakeRegisteredPackageRepositories();
		}
コード例 #31
0
		void CreateUpdateAllPackagesInSolution()
		{
			fakeSolution = new FakePackageManagementSolution();
			fakeSourceRepository = new FakePackageRepository();
			updateAllPackagesInSolution = new UpdateAllPackagesInSolution(fakeSolution, fakeSourceRepository);
		}