/// <inheritdoc />
        public IContainer Create(IDictionary <Type, string> strategies, Assembly moduleAssembly)
        {
            var container = new LocalContainer(strategies)
                            .ExecuteInstaller(new AutoInstaller(moduleAssembly));

            return(container);
        }
Пример #2
0
        private static IContainer CreateContainer(IDictionary <Type, string> strategies)
        {
            var container = new LocalContainer(strategies);

            container.LoadComponents <IRootClass>();
            container.LoadComponents <IConfiguredComponent>();

            container.Register <IRootClassFactory>();

            return(container);
        }
Пример #3
0
 public WebDriverManager(WebDriverConfig config)
 {
     Config = config;
     _container = new ThreadLocal<LocalContainer>(() =>
     {
         var cont = new LocalContainer();
         cont._driver = Config.CreateDriver();
         cont._javaScriptExecutor = new JavaScriptExecutor(cont._driver);
         cont._wait = new WebDriverWait(cont._driver, Config.WaitTimeout);
         return cont;
     });
 }
Пример #4
0
 public WebDriverManager(WebDriverConfig config)
     : base(config)
 {
     Config     = config;
     _container = new ThreadLocal <LocalContainer>(() =>
     {
         var cont                = new LocalContainer();
         cont.Driver             = Config.CreateDriver();
         cont.Wait               = new WebDriverWait(cont.Driver, Config.WaitTimeout);
         cont.JavaScriptExecutor = cont.Driver as IJavaScriptExecutor;
         if (cont.JavaScriptExecutor == null && Config.IsJavaScriptEnabled)
         {
             throw new TestLibsException($"Can't initialize JavaScript executor for WebDriver: {cont.Driver}");
         }
         return(cont);
     });
 }
Пример #5
0
 public WebDriverManager(WebDriverConfig config)
     : base(config)
 {
     Config = config;
     _container = new ThreadLocal<LocalContainer>(() =>
     {
         var cont = new LocalContainer();
         cont.Driver = Config.CreateDriver();
         cont.Wait = new WebDriverWait(cont.Driver, Config.WaitTimeout);
         cont.JavaScriptExecutor = cont.Driver as IJavaScriptExecutor;
         if (cont.JavaScriptExecutor == null && Config.IsJavaScriptEnabled)
         {
             throw new TestLibsException($"Can't initialize JavaScript executor for WebDriver: {cont.Driver}");
         }
         return cont;
     });
 }
Пример #6
0
 public void Init()
 {
     _container = new LocalContainer();
     _container.ExecuteInstaller(new AutoInstaller(GetType().Assembly));
 }