public void TestInitialize() { this.serviceProvider = new ConfigurableServiceProvider(false); this.host = new ConfigurableHost(this.serviceProvider, Dispatcher.CurrentDispatcher); var mefExport1 = MefTestHelpers.CreateExport <IHost>(this.host); this.activeSolutionTracker = new ConfigurableActiveSolutionTracker(); var mefExport2 = MefTestHelpers.CreateExport <IActiveSolutionTracker>(this.activeSolutionTracker); var mefModel = ConfigurableComponentModel.CreateWithExports(mefExport1, mefExport2); this.serviceProvider.RegisterService(typeof(SComponentModel), mefModel, replaceExisting: true); this.solutionMock = new SolutionMock(); this.serviceProvider.RegisterService(typeof(SVsSolution), this.solutionMock); this.errorListController = new ConfigurableErrorListInfoBarController(); this.serviceProvider.RegisterService(typeof(IErrorListInfoBarController), this.errorListController); this.solutionBindingInformationProvider = new ConfigurableSolutionBindingInformationProvider(); this.serviceProvider.RegisterService(typeof(ISolutionBindingInformationProvider), this.solutionBindingInformationProvider); }
public void TestInitialize() { this.serviceProvider = new ConfigurableServiceProvider(); this.menuService = new ConfigurableMenuCommandService(); this.serviceProvider.RegisterService(typeof(IMenuCommandService), this.menuService); var projectSystem = new ConfigurableVsProjectSystemHelper(this.serviceProvider); this.serviceProvider.RegisterService(typeof(IProjectSystemHelper), projectSystem); var host = new ConfigurableHost(this.serviceProvider, Dispatcher.CurrentDispatcher); var propManager = new ProjectPropertyManager(host); var propManagerExport = MefTestHelpers.CreateExport <IProjectPropertyManager>(propManager); var teController = new ConfigurableTeamExplorerController(); var teExport = MefTestHelpers.CreateExport <ITeamExplorerController>(teController); var mefModel = ConfigurableComponentModel.CreateWithExports(teExport, propManagerExport); this.serviceProvider.RegisterService(typeof(SComponentModel), mefModel); }
private ConfigurablePackageInstaller PrepareInstallPackagesTest(NuGetBindingOperation testSubject, Dictionary <Language, IEnumerable <PackageName> > nugetPackagesByLanguage) { var exportResponse = new RoslynExportProfileResponse(); exportResponse.Deployment = new DeploymentResponse(); exportResponse.Deployment.NuGetPackages = new List <NuGetPackageInfoResponse>(); foreach (var nugetPackagesForLanguage in nugetPackagesByLanguage) { testSubject.NuGetPackages.Add(nugetPackagesForLanguage.Key, nugetPackagesForLanguage.Value.Select(x => new NuGetPackageInfoResponse { Id = x.Id, Version = x.Version.ToNormalizedString() }).ToList()); } ConfigurablePackageInstaller packageInstaller = new ConfigurablePackageInstaller(nugetPackagesByLanguage.Values.SelectMany(x => x)); this.serviceProvider.RegisterService(typeof(SComponentModel), ConfigurableComponentModel.CreateWithExports(MefTestHelpers.CreateExport <IVsPackageInstaller>(packageInstaller))); return(packageInstaller); }
public void TestInitialize() { this.serviceProvider = new ConfigurableServiceProvider(); this.dte = new DTEMock(); this.dte.Solution = new SolutionMock(dte, Path.Combine(this.TestContext.TestRunDirectory, this.TestContext.TestName, "solution.sln")); this.serviceProvider.RegisterService(typeof(DTE), this.dte); var outputWindow = new ConfigurableVsOutputWindow(); this.outputPane = outputWindow.GetOrCreateSonarLintPane(); this.serviceProvider.RegisterService(typeof(SVsOutputWindow), outputWindow); this.store = new ConfigurableCredentialStore(); this.serviceProvider.RegisterService(typeof(ICredentialStoreService), this.store); this.projectSystemHelper = new ConfigurableVsProjectSystemHelper(this.serviceProvider) { SolutionItemsProject = this.dte.Solution.AddOrGetProject("Solution Items") }; this.serviceProvider.RegisterService(typeof(IProjectSystemHelper), this.projectSystemHelper); this.sourceControlledFileSystem = new ConfigurableSourceControlledFileSystem(); this.serviceProvider.RegisterService(typeof(ISourceControlledFileSystem), this.sourceControlledFileSystem); this.solutionRuleSetsInfoProvider = new ConfigurableSolutionRuleSetsInformationProvider { SolutionRootFolder = Path.GetDirectoryName(this.dte.Solution.FilePath) }; this.serviceProvider.RegisterService(typeof(ISolutionRuleSetsInformationProvider), this.solutionRuleSetsInfoProvider); var mefExport = MefTestHelpers.CreateExport <ILogger>(new SonarLintOutputLogger(serviceProvider)); var mefModel = ConfigurableComponentModel.CreateWithExports(mefExport); this.serviceProvider.RegisterService(typeof(SComponentModel), mefModel); }
public void TestInit() { this.serviceProvider = new ConfigurableServiceProvider(); var outputWindow = new ConfigurableVsOutputWindow(); this.outputWindowPane = outputWindow.GetOrCreateSonarLintPane(); this.serviceProvider.RegisterService(typeof(SVsOutputWindow), outputWindow); this.host = new ConfigurableHost(this.serviceProvider, Dispatcher.CurrentDispatcher); this.ruleSetInspector = null; this.sccFS = null; this.rsSerializer = null; this.conflictsManager = new ConfigurableConflictsManager(); IComponentModel componentModel = ConfigurableComponentModel.CreateWithExports( new Export[] { MefTestHelpers.CreateExport <ITelemetryLogger>(new ConfigurableTelemetryLogger()) }); this.serviceProvider.RegisterService(typeof(SComponentModel), componentModel); }