public virtual void RegisterDefaults(IObjectContainer container) { var serviceProvider = container.Resolve <IServiceProvider>(); RegisterVsDependencies(container, serviceProvider); container.RegisterTypeAs <InstallServices, InstallServices>(); container.RegisterTypeAs <InstallServicesHelper, InstallServicesHelper>(); container.RegisterTypeAs <VsBrowserGuidanceNotificationService, IGuidanceNotificationService>(); container.RegisterTypeAs <WindowsFileAssociationDetector, IFileAssociationDetector>(); container.RegisterTypeAs <RegistryStatusAccessor, IStatusAccessor>(); container.RegisterInstanceAs <IIdeTracer>(VsxHelper.ResolveMefDependency <IVisualStudioTracer>(serviceProvider)); container.RegisterInstanceAs(VsxHelper.ResolveMefDependency <IProjectScopeFactory>(serviceProvider)); container.RegisterTypeAs <StepDefinitionSkeletonProvider, IStepDefinitionSkeletonProvider>(); container.RegisterTypeAs <DefaultSkeletonTemplateProvider, ISkeletonTemplateProvider>(); container.RegisterTypeAs <StepTextAnalyzer, IStepTextAnalyzer>(); container.RegisterTypeAs <TelemetryClientWrapper, TelemetryClientWrapper>(); container.RegisterTypeAs <AppInsightsExtensionLoadedDataTransformer, IAppInsightsEventConverter <ExtensionLoadedAnalyticsEvent> >(); container.RegisterTypeAs <AppInsightsAnalyticsTransmitterSink, IAnalyticsTransmitterSink>(); container.RegisterTypeAs <VisualStudioProjectTargetFrameworksProvider, IProjectTargetFrameworksProvider>(); container.RegisterTypeAs <VisualStudioIdeInformationStore, IIdeInformationStore>(); container.RegisterTypeAs <AnalyticsTransmitter, IAnalyticsTransmitter>(); container.RegisterTypeAs <EnableAnalyticsChecker, IEnableAnalyticsChecker>(); container.RegisterTypeAs <RegistryUserUniqueIdStore, IUserUniqueIdStore>(); RegisterCommands(container); }
public virtual void RegisterDefaults(IObjectContainer container) { var serviceProvider = container.Resolve <IServiceProvider>(); RegisterVsDependencies(container, serviceProvider); container.RegisterTypeAs <InstallServices, InstallServices>(); container.RegisterTypeAs <InstallServicesHelper, InstallServicesHelper>(); container.RegisterTypeAs <VsBrowserGuidanceNotificationService, IGuidanceNotificationService>(); container.RegisterTypeAs <WindowsFileAssociationDetector, IFileAssociationDetector>(); container.RegisterTypeAs <RegistryStatusAccessor, IStatusAccessor>(); container.RegisterTypeAs <IntegrationOptionsProvider, IIntegrationOptionsProvider>(); container.RegisterInstanceAs <IIdeTracer>(VsxHelper.ResolveMefDependency <IVisualStudioTracer>(serviceProvider)); container.RegisterInstanceAs(VsxHelper.ResolveMefDependency <IProjectScopeFactory>(serviceProvider)); container.RegisterTypeAs <TestRunnerEngine, ITestRunnerEngine>(); container.RegisterTypeAs <TestRunnerGatewayProvider, ITestRunnerGatewayProvider>(); container.RegisterTypeAs <ReSharper6TestRunnerGateway, ITestRunnerGateway>(TestRunnerTool.ReSharper.ToString()); container.RegisterTypeAs <SpecRunTestRunnerGateway, ITestRunnerGateway>(TestRunnerTool.SpecRun.ToString()); container.RegisterTypeAs <VsTestExplorerGateway, ITestRunnerGateway>(TestRunnerTool.VisualStudio2012.ToString()); container.RegisterTypeAs <AutoTestRunnerGateway, ITestRunnerGateway>(TestRunnerTool.Auto.ToString()); container.RegisterTypeAs <StepDefinitionSkeletonProvider, IStepDefinitionSkeletonProvider>(); container.RegisterTypeAs <DefaultSkeletonTemplateProvider, ISkeletonTemplateProvider>(); container.RegisterTypeAs <StepTextAnalyzer, IStepTextAnalyzer>(); RegisterCommands(container); }
private bool RunInCurrentContext(string fileName, bool debug, int lineNumber = -1) { try { const string testWindowAssemblyName = "Microsoft.VisualStudio.TestWindow, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; const string testWindowInterfacesAssemblyName = "Microsoft.VisualStudio.TestWindow.Interfaces, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; var tIRunCommandsExecutor = Type.GetType("Microsoft.VisualStudio.TestWindow.Controller.IRunCommandsExecutor, " + testWindowAssemblyName, true); Type tHostContext = Type.GetType("Microsoft.VisualStudio.TestWindow.Extensibility.Model.HostContext, " + testWindowInterfacesAssemblyName, false) ?? Type.GetType("Microsoft.VisualStudio.TestWindow.Host.HostContext, " + testWindowAssemblyName, true); // support for VS2012 Update 1 var runCommandsExecutor = VsxHelper.ResolveMefDependency(serviceProvider, tIRunCommandsExecutor); var hostContext = Activator.CreateInstance(tHostContext, fileName, lineNumber, -1); string methodNameToInvoke = debug ? "OnInvokeDebugTestsInContext" : "OnInvokeRunTestsInContext"; var method = tIRunCommandsExecutor.GetMethod(methodNameToInvoke); method.Invoke(runCommandsExecutor, new[] { hostContext }); return(true); } catch (Exception ex) { tracer.Trace("test tool error: {0}", this, ex); return(false); } }
public virtual void RegisterDefaults(IObjectContainer container) { var serviceProvider = container.Resolve <IServiceProvider>(); RegisterVsDependencies(container, serviceProvider); container.RegisterTypeAs <InstallServices, InstallServices>(); container.RegisterTypeAs <InstallServicesHelper, InstallServicesHelper>(); container.RegisterTypeAs <VsBrowserGuidanceNotificationService, IGuidanceNotificationService>(); container.RegisterTypeAs <WindowsFileAssociationDetector, IFileAssociationDetector>(); container.RegisterTypeAs <RegistryStatusAccessor, IStatusAccessor>(); container.RegisterTypeAs <IntegrationOptionsProvider, IIntegrationOptionsProvider>(); container.RegisterInstanceAs <IIdeTracer>(VsxHelper.ResolveMefDependency <IVisualStudioTracer>(serviceProvider)); container.RegisterInstanceAs(VsxHelper.ResolveMefDependency <IProjectScopeFactory>(serviceProvider)); container.RegisterTypeAs <StepDefinitionSkeletonProvider, IStepDefinitionSkeletonProvider>(); container.RegisterTypeAs <DefaultSkeletonTemplateProvider, ISkeletonTemplateProvider>(); container.RegisterTypeAs <StepTextAnalyzer, IStepTextAnalyzer>(); container.RegisterTypeAs <ConsoleAnalyticsTransmitterSink, IAnalyticsTransmitterSink>(); container.RegisterTypeAs <AnalyticsTransmitter, IAnalyticsTransmitter>(); container.RegisterTypeAs <EnableAnalyticsChecker, IEnableAnalyticsChecker>(); container.RegisterTypeAs <RegistryUserUniqueIdStore, IUserUniqueIdStore>(); RegisterCommands(container); }
protected override Func <GeneratorServices> GeneratorServicesProvider(Project project) { IVisualStudioTracer tracer = VsxHelper.ResolveMefDependency <IVisualStudioTracer>(ServiceProvider.GlobalProvider); IntegrationOptionsProvider = VsxHelper.ResolveMefDependency <IIntegrationOptionsProvider>(ServiceProvider.GlobalProvider); return(() => new VsGeneratorServices(project, new VsSpecFlowConfigurationReader(project, tracer), tracer, IntegrationOptionsProvider)); }
public virtual void RegisterDefaults(IObjectContainer container) { var serviceProvider = container.Resolve <IServiceProvider>(); RegisterVsDependencies(container, serviceProvider); RegisterDependencies(container); container.RegisterInstanceAs <IIdeTracer>(VsxHelper.ResolveMefDependency <IVisualStudioTracer>(serviceProvider)); container.RegisterInstanceAs(VsxHelper.ResolveMefDependency <IProjectScopeFactory>(serviceProvider)); RegisterCommands(container); }
protected virtual void RegisterVsDependencies(IObjectContainer container, IServiceProvider serviceProvider) { var dte = serviceProvider.GetService(typeof(DTE)) as DTE; if (dte != null) { container.RegisterInstanceAs(dte); container.RegisterInstanceAs((DTE2)dte); } container.RegisterInstanceAs(VsxHelper.ResolveMefDependency <IOutputWindowService>(serviceProvider)); container.RegisterInstanceAs(VsxHelper.ResolveMefDependency <IGherkinLanguageServiceFactory>(serviceProvider)); }
private bool RunInCurrentContext(string fileName, bool debug) { try { IRunCommandsExecutor runCommandsExecutor = VsxHelper.ResolveMefDependency <IRunCommandsExecutor>(serviceProvider); if (debug) { runCommandsExecutor.OnInvokeDebugTestsInContext(new HostContext(fileName)); } else { runCommandsExecutor.OnInvokeRunTestsInContext(new HostContext(fileName)); } return(true); } catch (Exception ex) { tracer.Trace("test tool error: {0}", this, ex); return(false); } }