public void Start() { switch (BaseConfiguration.TestBrowser) { case BrowserType.Firefox: var fireFoxOptionsLegacy = new FirefoxOptions { Profile = this.FirefoxProfile, UseLegacyImplementation = BaseConfiguration.FirefoxUseLegacyImplementation }; this.driver = new FirefoxDriver(fireFoxOptionsLegacy); break; case BrowserType.FirefoxPortable: var fireFoxOptions = new FirefoxOptions { BrowserExecutableLocation = BaseConfiguration.FirefoxPath, Profile = this.FirefoxProfile, UseLegacyImplementation = BaseConfiguration.FirefoxUseLegacyImplementation }; this.driver = new FirefoxDriver(fireFoxOptions); break; case BrowserType.InternetExplorer: this.driver = new InternetExplorerDriver(this.InternetExplorerProfile); break; case BrowserType.Chrome: this.driver = new ChromeDriver(this.ChromeProfile); break; case BrowserType.Safari: this.driver = new SafariDriver(this.SafariProfile); break; //case BrowserType.PhantomJs: //this.driver = new PhantomJSDriver(this.CurrentDirectory + BaseConfiguration.PhantomJsPath); //break; //case BrowserType.RemoteWebDriver: //this.driver = new RemoteWebDriver(BaseConfiguration.RemoteWebDriverHub, this.SetCapabilities()); //break; default: throw new NotSupportedException( string.Format(CultureInfo.CurrentCulture, "Driver {0} is not supported", BaseConfiguration.TestBrowser)); } this.driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(BaseConfiguration.LongTimeout); this.driver.Manage().Timeouts().AsynchronousJavaScript = TimeSpan.FromSeconds(BaseConfiguration.ShortTimeout); this.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromMilliseconds(BaseConfiguration.ImplicitlyWaitMilliseconds); //if (BaseConfiguration.EnableEventFiringWebDriver) //{ // this.driver = new MyEventFiringWebDriver(this.driver); //} this.fiddler = new FiddlerProxy(); this.ngDriver = new NgWebDriver(this.driver); this.mongo = new MongoDriver(this); }
public BsonDocumentValues(MongoDriver mongo) { Mongo = mongo; int count = typeof(BsonDocumentValues).GetProperties().Count(); if (Field.DocumentFields.Length != count) { throw new Exception("BsonDocumentFields and BsonDocumentValues do not match. Add or take away from either so they match."); } SetValuesToBlankDocument(); }
static void Main(string[] args) { MongoDriver.ConfigureDriver(); LockEventManager lockEventManager = new LockEventManager(); lockEventManager.StartHandling(); Console.WriteLine("LockEventProcesser LockEvent subscriber started"); Console.ReadLine(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { //if (env.IsDevelopment()) //{ // app.UseDeveloperExceptionPage(); //} //else //{ // app.UseExceptionHandler("/Error"); //} app.UseMiddleware(typeof(ErrorHandlingMiddleware)); app.UseStaticFiles(); app.UseSpaStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller}/{action=Index}/{id?}"); }); app.UseSpa(spa => { // To learn more about options for serving an Angular SPA from ASP.NET Core, // see https://go.microsoft.com/fwlink/?linkid=864501 spa.Options.SourcePath = "ClientApp"; if (env.IsDevelopment()) { spa.UseAngularCliServer(npmScript: "start"); } }); MongoDriver.ConfigureDriver(); }
public MongoDriverProgram() { mongoDriver = new MongoDriver(connectionString); }
public HomeController() { _dbConnection = new MongoDriver(); }
public GamesController() { _dbConnection = new MongoDriver(); }
public static string GetUserEmail(this MongoDriver mongo, Dictionary <string, object> filterFieldAndValue, bool isFirstInArray = true) { return(mongo.GetValueFromDocument(filterFieldAndValue, Field.EmailAddress, isFirstInArray).ToString()); }
public static void DeleteFromMongoDb(this MongoDriver mongo, string emailAddress) { mongo.DeleteDocument(new Dictionary <string, object> { { Field.EmailAddress, emailAddress } }); }
public static string GetRandomUserEmail(this MongoDriver mongo) { return(mongo.GetValueFromDocument(new Dictionary <string, object> { { Field.EnvironmentCreatedOn, BaseConfiguration.Base } }, Field.EmailAddress, false).ToString()); }
public static string GetSocialCredentials(this MongoDriver mongo, string credential, bool isFirstInArray = true) { return(mongo.GetValueFromDocument(new Dictionary <string, object> { { "SocialCredentials", "PronetAutomation" } }, credential, isFirstInArray).ToString()); }
public UsersController() { _dbConnection = new MongoDriver(); }