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 CreateUserPrompts()
		{
			fakeEvents = MockRepository.GenerateStub<IPackageManagementEvents>();
			fakeLicenseService = MockRepository.GenerateStub<ILicenseAcceptanceService>();
			fakeSelectProjectsService = MockRepository.GenerateStub<ISelectProjectsService>();
			fakeFileConflictResolver = MockRepository.GenerateStub<IFileConflictResolver>();
			
			userPrompts = new ManagePackagesUserPrompts(
				fakeEvents,
				fakeLicenseService,
				fakeSelectProjectsService,
				fakeFileConflictResolver);
		}
Beispiel #3
0
        public ManagePackagesViewModel(
            PackagesViewModels packagesViewModels,
            ManagePackagesViewTitle viewTitle,
            IThreadSafePackageManagementEvents packageManagementEvents,
            ManagePackagesUserPrompts userPrompts)
        {
            this.packagesViewModels      = packagesViewModels;
            this.viewTitle               = viewTitle;
            this.packageManagementEvents = packageManagementEvents;
            this.userPrompts             = userPrompts;

            packageManagementEvents.PackageOperationError     += PackageOperationError;
            packageManagementEvents.PackageOperationsStarting += PackageOperationsStarting;

            packagesViewModels.ReadPackages();
        }