void CreateSolution()
 {
     packageManagementEvents = new PackageManagementEvents();
     fakeProject             = new FakePackageManagementProject();
     action = new UpdatePackageAction(fakeProject, packageManagementEvents);
     updatePackageHelper = new UpdatePackageHelper(action);
 }
Esempio n. 2
0
 void CreateSolution()
 {
     packageManagerFactory  = new FakePackageManagerFactory();
     packageRepositoryCache = new FakePackageRepositoryFactory();
     packageEvents          = new PackageManagementEvents();
     solution = new FakePackageManagementSolution();
 }
		void CreateAction ()
		{
			project = new FakeDotNetProject (@"d:\projects\MyProject\MyProject.csproj");
			solutionManager = new FakeSolutionManager ();
			nugetProject = new FakeNuGetProject (project);
			solutionManager.NuGetProjects[project] = nugetProject;

			var metadataResourceProvider = new FakePackageMetadataResourceProvider ();
			packageMetadataResource = metadataResourceProvider.PackageMetadataResource;
			var source = new PackageSource ("http://test.com");
			var providers = new INuGetResourceProvider[] {
				metadataResourceProvider
			};
			var sourceRepository = new SourceRepository (source, providers);
			primaryRepositories = new [] {
				sourceRepository
			}.ToList ();
			solutionManager.SourceRepositoryProvider.Repositories.AddRange (primaryRepositories);

			action = new TestableUpdateAllNuGetPackagesInProjectAction (
				solutionManager,
				project);

			packageManager = action.PackageManager;
			packageManagementEvents = action.PackageManagementEvents;
			fileRemover = action.FileRemover;
			restoreManager = action.RestoreManager;
		}
Esempio n. 4
0
        void CreateViewModel(FakePackageManagementSolution solution)
        {
            packageManagementEvents = new PackageManagementEvents();
            var threadSafeEvents = new ThreadSafePackageManagementEvents(packageManagementEvents, new FakePackageManagementWorkbench());

            CreateViewModel(fakeSolution, threadSafeEvents);
        }
 public TestablePackageReferenceNuGetProject(
     DotNetProject project,
     PackageManagementEvents packageManagementEvents)
     : base(project, packageManagementEvents)
 {
     PackageManagementEvents = packageManagementEvents;
 }
Esempio n. 6
0
 void CreateProgressMonitor()
 {
     progressMonitorFactory = new FakeProgressMonitorFactory();
     fakeProgressMonitor    = progressMonitorFactory.ProgressMonitor;
     packageEvents          = new PackageManagementEvents();
     progressMonitor        = new TestableCheckForUpdatesProgressMonitor(progressMonitorFactory, packageEvents);
 }
Esempio n. 7
0
 public TestablePackageReferenceNuGetProject(
     DotNetProject project,
     PackageManagementEvents packageManagementEvents)
     : base(project, ConfigurationSelector.Default, packageManagementEvents)
 {
     PackageManagementEvents = packageManagementEvents;
 }
 void CreateAction()
 {
     packageManagementEvents = new PackageManagementEvents();
     fakeProject             = new FakePackageManagementProject();
     action = new UninstallPackageAction(fakeProject, packageManagementEvents);
     uninstallPackageHelper = new UninstallPackageHelper(action);
 }
        void CreateAction(string projectName = "MyProject", params ProjectReference[] projectReferences)
        {
            project      = new FakeDotNetProject(@"d:\projects\MyProject\MyProject.csproj");
            project.Name = projectName;
            project.References.AddRange(projectReferences);
            solutionManager = new FakeSolutionManager();
            nugetProject    = new FakeNuGetProject(project);
            solutionManager.NuGetProjects[project] = nugetProject;

            var metadataResourceProvider = new FakePackageMetadataResourceProvider();

            packageMetadataResource = metadataResourceProvider.PackageMetadataResource;
            var source    = new PackageSource("http://test.com");
            var providers = new INuGetResourceProvider[] {
                metadataResourceProvider
            };
            var sourceRepository = new SourceRepository(source, providers);

            primaryRepositories = new [] {
                sourceRepository
            }.ToList();
            solutionManager.SourceRepositoryProvider.Repositories.AddRange(primaryRepositories);

            action = new TestableUpdateAllNuGetPackagesInProjectAction(
                solutionManager,
                project);

            packageManager          = action.PackageManager;
            packageManagementEvents = action.PackageManagementEvents;
            fileRemover             = action.FileRemover;
            restoreManager          = action.RestoreManager;
        }
Esempio n. 10
0
 void CreateAction()
 {
     packageManagementEvents = new PackageManagementEvents();
     fakeProject             = new FakePackageManagementProject();
     fileRemover             = new FakeFileRemover();
     action = new TestableInstallPackageAction(fakeProject, packageManagementEvents, fileRemover);
     installPackageHelper = new InstallPackageHelper(action);
 }
Esempio n. 11
0
 void CreateSolution()
 {
     packageManagementEvents = new PackageManagementEvents();
     fakeProject             = new FakePackageManagementProject();
     fileRemover             = new FakeFileRemover();
     action = new TestableUpdatePackageAction(fakeProject, packageManagementEvents, fileRemover);
     updatePackageHelper = new UpdatePackageHelper(action);
 }
Esempio n. 12
0
 void CreateProject(string name, string fileName = @"d:\projects\MyProject\MyProject.csproj")
 {
     packageManagementEvents = new PackageManagementEvents();
     logger   = new PackageManagementLogger(packageManagementEvents);
     solution = new FakeSolution();
     project  = new FakeDotNetProject(fileName.ToNativePath());
     project.ParentSolution = solution;
     project.Name           = name;
 }
 public TestableProcessPackageAction(
     FakePackageManagementProject project,
     PackageManagementEvents packageManagementEvents)
     : base(project, packageManagementEvents)
 {
     FakeProject             = project;
     PackageManagementEvents = packageManagementEvents;
     this.Package            = FakePackage;
 }
Esempio n. 14
0
        void CreateLogger()
        {
            messagesLoggedEventArgs = new List <PackageOperationMessageLoggedEventArgs> ();
            packageManagementEvents = new PackageManagementEvents();
            packageManagementEvents.PackageOperationMessageLogged += (sender, e) => {
                messagesLoggedEventArgs.Add(e);
            };

            logger = new PackageManagementLogger(packageManagementEvents);
        }
 void CreateViewModel(FakePackageManagementSolution solution)
 {
     viewModelParent            = CreateViewModelParent(solution);
     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);
 }
Esempio n. 17
0
        void CreateAction(string packageId = "MyPackage", string packageVersion = "1.2.3.4")
        {
            project = new FakePackageManagementProject();
            project.AddFakeInstallOperation();

            packageManagementEvents = new PackageManagementEvents();

            action                = new ReinstallPackageAction(project, packageManagementEvents);
            action.PackageId      = packageId;
            action.PackageVersion = new SemanticVersion(packageVersion);
        }
Esempio n. 18
0
 TestableMonoDevelopProjectSystem(
     IDotNetProject project,
     FakeNuGetProjectContext context,
     IPackageManagementFileService fileService,
     PackageManagementEvents packageManagementEvents)
     : base(project, context, fileService, packageManagementEvents, GuiSyncDispatcher, GuiSyncDispatcherFunc)
 {
     FakeNuGetProjectContext = context;
     FakeFileService         = (FakeFileService)fileService;
     PackageManagementEvents = packageManagementEvents;
 }
		TestableMonoDevelopProjectSystem (
			IDotNetProject project,
			FakeNuGetProjectContext context,
			IPackageManagementFileService fileService,
			PackageManagementEvents packageManagementEvents)
			: base (project, context, fileService, packageManagementEvents, GuiSyncDispatcher, GuiSyncDispatcherFunc)
		{
			FakeNuGetProjectContext = context;
			FakeFileService = (FakeFileService)fileService;
			PackageManagementEvents = packageManagementEvents;
		}
 void CreateProvider()
 {
     fakeSolution = new FakePackageManagementSolution();
     fakeRegisteredRepositories = new FakeRegisteredPackageRepositories();
     fakePowerShellDetection    = new FakePowerShellDetection();
     packageEvents = new PackageManagementEvents();
     provider      = new PackageManagementConsoleHostProvider(
         fakeSolution,
         fakeRegisteredRepositories,
         fakePowerShellDetection,
         packageEvents);
 }
        void CreateViewModel()
        {
            registeredPackageRepositories = new FakeRegisteredPackageRepositories();
            taskFactory = new FakeTaskFactory();
            var packageViewModelFactory = new FakePackageViewModelFactory();

            packageManagementEvents = new PackageManagementEvents();
            viewModel = new RecentPackagesViewModel(
                packageManagementEvents,
                registeredPackageRepositories,
                packageViewModelFactory,
                taskFactory);
        }
        public DesignTimePackagesViewModel(
			DesignTimeRegisteredPackageRepositories registeredPackageRepositories,
			FakePackageManagementSolution solution,
			PackageManagementEvents packageManagementEvents)
            : base(solution,
				packageManagementEvents,
				registeredPackageRepositories,
				new PackageViewModelFactory(solution, packageManagementEvents, null),
				new PackageManagementTaskFactory())
        {
            PageSize = 3;
            AddPackageViewModels();
        }
 TestableMonoDevelopProjectSystem(
     IDotNetProject project,
     IPackageManagementFileService fileService,
     IPackageManagementProjectService projectService,
     PackageManagementEvents packageManagementEvents,
     FakeLogger logger)
     : base(project, fileService, projectService, packageManagementEvents, GuiSyncDispatcher, GuiSyncDispatcherFunc)
 {
     FakeFileService         = (FakeFileService)fileService;
     FakeProjectService      = (FakePackageManagementProjectService)projectService;
     PackageManagementEvents = packageManagementEvents;
     Logger = logger;
 }
        void CreateViewModel(FakeRegisteredPackageRepositories registeredPackageRepositories)
        {
            this.registeredPackageRepositories = registeredPackageRepositories;
            taskFactory = new FakeTaskFactory();
            var packageViewModelFactory = new FakePackageViewModelFactory();

            packageManagementEvents = new PackageManagementEvents();
            viewModel = new TestableRecentPackagesViewModel(
                new FakePackageManagementSolution(),
                packageManagementEvents,
                registeredPackageRepositories,
                packageViewModelFactory,
                taskFactory);
        }
Esempio n. 25
0
        void CreateProject(IPackageRepository sourceRepository)
        {
            fakePackageManagerFactory = new FakePackageManagerFactory();
            fakePackageManager        = fakePackageManagerFactory.FakePackageManager;
            fakeProjectManager        = fakePackageManager.FakeProjectManager;
            fakeProject             = new FakeDotNetProject();
            packageManagementEvents = new PackageManagementEvents();

            project = new PackageManagementProject(
                sourceRepository,
                fakeProject,
                packageManagementEvents,
                fakePackageManagerFactory);
        }
        void CreateRunner()
        {
            actions                 = new List <IPackageAction> ();
            progressMessage         = new ProgressMonitorStatusMessage("Status", "Success", "Error", "Warning");
            packageManagementEvents = new PackageManagementEvents();
            progressMonitorFactory  = new FakeProgressMonitorFactory();
            progressMonitor         = progressMonitorFactory.ProgressMonitor;
            instrumentationService  = new TestableInstrumentationService();

            runner = new TestableBackgroundPackageActionRunner(
                progressMonitorFactory,
                packageManagementEvents,
                instrumentationService);
        }
		void CreateRunner ()
		{
			actions = new List<IPackageAction> ();
			progressMessage = new ProgressMonitorStatusMessage ("Status", "Success", "Error", "Warning");
			packageManagementEvents = new PackageManagementEvents ();
			progressMonitorFactory = new FakeProgressMonitorFactory ();
			progressMonitor = progressMonitorFactory.ProgressMonitor;
			instrumentationService = new TestableInstrumentationService ();

			runner = new TestableBackgroundPackageActionRunner (
				progressMonitorFactory,
				packageManagementEvents,
				instrumentationService);
		}
Esempio n. 28
0
        void CreateRunner()
        {
            project      = new FakeDotNetProject(@"d:\projects\MyProject\MyProject.csproj");
            project.Name = "MyProject";
            project.TargetFrameworkMoniker = new TargetFrameworkMoniker("4.5");
            progressMonitorFactory         = new FakeProgressMonitorFactory();
            progressMonitor         = progressMonitorFactory.ProgressMonitor;
            packageManagementEvents = new PackageManagementEvents();

            runner = new TestablePackageCompatibilityRunner(
                project,
                progressMonitorFactory,
                packageManagementEvents);
        }
		void CreateRunner ()
		{
			project = new FakeDotNetProject (@"d:\projects\MyProject\MyProject.csproj");
			project.Name = "MyProject";
			project.TargetFrameworkMoniker = new TargetFrameworkMoniker ("4.5");
			progressMonitorFactory = new FakeProgressMonitorFactory ();
			progressMonitor = progressMonitorFactory.ProgressMonitor;
			packageManagementEvents = new PackageManagementEvents ();

			runner = new TestablePackageCompatibilityRunner (
				project,
				progressMonitorFactory,
				packageManagementEvents);
		}
 public DesignTimePackagesViewModel(
     DesignTimeRegisteredPackageRepositories registeredPackageRepositories,
     FakePackageManagementSolution solution,
     PackageManagementEvents packageManagementEvents)
     : base(
         solution,
         packageManagementEvents,
         registeredPackageRepositories,
         new PackageViewModelFactory(solution, packageManagementEvents, null),
         new PackageManagementTaskFactory())
 {
     PageSize = 3;
     AddPackageViewModels();
 }
 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);
 }
		public TestableReinstallNuGetPackageAction (
			FakeDotNetProject dotNetProject,
			FakeSolutionManager solutionManager,
			FakeNuGetProjectContext projectContext,
			PackageManagementEvents packageManagementEvents)
			: base (
				dotNetProject,
				solutionManager,
				projectContext,
				packageManagementEvents)
		{
			ProjectContext = projectContext;

			PackageManagementEvents = packageManagementEvents;
		}
        public TestableReinstallNuGetPackageAction(
            FakeDotNetProject dotNetProject,
            FakeSolutionManager solutionManager,
            FakeNuGetProjectContext projectContext,
            PackageManagementEvents packageManagementEvents)
            : base(
                dotNetProject,
                solutionManager,
                projectContext,
                packageManagementEvents)
        {
            ProjectContext = projectContext;

            PackageManagementEvents = packageManagementEvents;
        }
        void CreateViewModel(FakePackageManagementSolution solution)
        {
            registeredPackageRepositories = new FakeRegisteredPackageRepositories();
            var packageViewModelFactory          = new FakePackageViewModelFactory();
            var installedPackageViewModelFactory = new InstalledPackageViewModelFactory(packageViewModelFactory);

            taskFactory             = new FakeTaskFactory();
            packageManagementEvents = new PackageManagementEvents();

            viewModel = new InstalledPackagesViewModel(
                solution,
                packageManagementEvents,
                registeredPackageRepositories,
                installedPackageViewModelFactory,
                taskFactory);
        }
        void CreateViewModelWithRealPackageManagementEvents()
        {
            CreateSolution();
            CreateRegisteredPackageRepositories();
            packageManagementEvents = new PackageManagementEvents();
            var actionRunner            = new FakePackageActionRunner();
            var packageViewModelFactory = new PackageViewModelFactory(solution, packageManagementEvents, actionRunner);

            updatedPackageViewModelFactory = new UpdatedPackageViewModelFactory(packageViewModelFactory);
            taskFactory = new FakeTaskFactory();

            viewModel = new UpdatedPackagesViewModel(
                solution,
                registeredPackageRepositories,
                updatedPackageViewModelFactory,
                taskFactory);
        }
        void CreateRunner()
        {
            actions                 = new List <IPackageAction> ();
            progressMessage         = new ProgressMonitorStatusMessage("Status", "Success", "Error", "Warning");
            packageManagementEvents = new PackageManagementEvents();
            progressMonitorFactory  = new FakeProgressMonitorFactory();
            progressMonitor         = progressMonitorFactory.ProgressMonitor;
            repositoryFactoryEvents = new FakePackageRepositoryFactoryEvents();
            progressProvider        = new PackageManagementProgressProvider(repositoryFactoryEvents, handler => {
                handler.Invoke();
            });

            runner = new TestableBackgroundPackageActionRunner(
                progressMonitorFactory,
                packageManagementEvents,
                progressProvider);
        }
		public TestableUpdateNuGetPackageAction (
			FakeSolutionManager solutionManager,
			FakeDotNetProject dotNetProject,
			FakeNuGetProjectContext projectContext,
			FakeNuGetPackageManager packageManager,
			PackageManagementEvents packageManagementEvents)
			: base (
				solutionManager,
				dotNetProject,
				projectContext,
				packageManager,
				packageManagementEvents)
		{
			ProjectContext = projectContext;
			PackageManager = packageManager;

			PackageManagementEvents = packageManagementEvents;
		}
		public TestableInstallNuGetPackageAction (
			IEnumerable<SourceRepository> primarySources,
			FakeSolutionManager solutionManager,
			FakeDotNetProject dotNetProject,
			FakeNuGetProjectContext projectContext,
			FakeNuGetPackageManager packageManager,
			PackageManagementEvents packageManagementEvents)
			: base (
				primarySources,
				null,
				solutionManager,
				dotNetProject,
				projectContext,
				packageManager,
				packageManagementEvents)
		{
			ProjectContext = projectContext;
			PackageManager = packageManager;

			PackageManagementEvents = packageManagementEvents;
		}
		void CreateEvents ()
		{
			events = new PackageManagementEvents ();
		}