protected virtual void ConfigureMSTestDependencies(DependencyInjectionContainer container) { ImplementationSelector defaultImplSelector = new ImplementationSelector(); this.ConfigureDependencyImplentationSelector(defaultImplSelector); DependencyInjectionConfigurator dependInjecConfigurator = new DependencyInjectionConfigurator(defaultImplSelector, new Dictionary<string, string>()); dependInjecConfigurator.ConfigureDefaultDependencies(container); this.ConfigureDependencies(container); // Configure MSTest only dependencies container.Register<Logger, TraceLogger>(); // Set test parameter ApplyTransform to false for ODL tests. container.TestParameters.Add("ApplyTransform", "false"); container.RegisterInstance(container); }
/// <summary> /// Injects default dependencies when Taupo runner is not being used /// </summary> protected void InjectDependencies() { var container = new LightweightDependencyInjectionContainer(); ImplementationSelector defaultImplSelector = new ImplementationSelector(); this.ConfigureDependencyImplentationSelector(defaultImplSelector); DependencyInjectionConfigurator dependInjecConfigurator = new DependencyInjectionConfigurator(defaultImplSelector, new Dictionary<string, string>()); dependInjecConfigurator.ConfigureDefaultDependencies(container); this.ConfigureDependencies(container); // Configure MSTest only dependencies container.Register<Logger, TraceLogger>(); container.RegisterInstance(container); container.InjectDependenciesInto(this); }
private void ConfigureDependencyInjectionContainer() { this.dependencyInjector = this.moduleDependencyInjectionContainer = new LightweightDependencyInjectionContainer(); var implementationSelector = new ImplementationSelector(); this.ConfigureImplementationSelector(implementationSelector); var configurator = new DependencyInjectionConfigurator(implementationSelector, this.TestParameters); configurator.RootLogger = this.rootLogger; configurator.ConfigureDefaultDependencies(this.moduleDependencyInjectionContainer); this.ConfigureDependencies(this.moduleDependencyInjectionContainer); this.dependencyInjector.InjectDependenciesInto(this); configurator.InitializeGlobalObjects(this.moduleDependencyInjectionContainer); }