public void SetAndReadValue( ) { ITestConfig conf = Config.New <ITestConfig>( ); conf.StringProp1 = "test value"; Assert.AreEqual("test value", conf.StringProp1); }
public void ConfigBackendSave( ) { TestBackend backend = new TestBackend( ); ITestConfig conf = Config.New <ITestConfig>( ); conf.Backend = backend; conf.StringProp1 = "saved string"; conf.IntProp = 12345; conf.Save( ); Assert.AreEqual("saved string", backend.Values["StringProp1"]); Assert.AreEqual(12345, backend.Values["IntProp"]); Assert.AreEqual(conf.Keys.Count( ), backend.Values.Count); }
public void ConfigBackendRead( ) { TestBackend backend = new TestBackend( ); backend.Values["StringProp1"] = "read string"; backend.Values["IntProp"] = 12345; ITestConfig conf = Config.New <ITestConfig>( ); conf.Backend = backend; conf.Read( ); Assert.AreEqual("read string", conf.StringProp1); Assert.AreEqual(12345, conf.IntProp); Assert.AreEqual("Hello World!", conf.StringProp2); }
public IMiruApp Start(ITestConfig config, Action <IServiceCollection> servicesSetup = null) { _testRunConfig = new TestRunConfig(); var servicesFromTestConfig = new ServiceCollection(); config.ConfigureRun(_testRunConfig); config.ConfigureTestServices(servicesFromTestConfig); var builder = config.GetHostBuilder(); builder.UseEnvironment("Test"); builder.ConfigureServices(services => { services.AddSingleton(this); services.AddSingleton <TestFixture, TestFixture>(); services.AddSingleton <ISessionStore, MemorySessionStore>(); services.AddSingleton <IUserSession, TestingUserSession>(); services.AddSingleton <Faker, Faker>(); // services.ReplaceSingleton<ILogger>(sp => TestLoggerConfigurations.ForTests(sp.GetService<Storage>())); services.AddRange(servicesFromTestConfig); // test engine stuff services.AddSingleton <TestConfigRunner>(); services.AddSingleton(_testRunConfig); servicesSetup?.Invoke(services); }); var host = builder.Build(); var sp = host.Services; App = sp.GetService <IMiruApp>(); ExecuteBeforeSuite(); return(App); }
public static IWebDriver CreateDriver(ITestConfig config) { var driverService = ChromeDriverService.CreateDefaultService(); var opt = new ChromeOptions(); opt.AddArgument("--ignore-certificate-errors"); if (config.Headless && !config.Debug) { opt.AddArgument("--window-size=1280,2048"); opt.AcceptInsecureCertificates = true; opt.AddArgument("--headless"); } opt.AddUserProfilePreference("download.default_directory", config.DownloadFolder); var driver = new ChromeDriver(driverService, opt, TimeSpan.FromMinutes(5)); driver.Manage().Timeouts().PageLoad = TimeSpan.FromMinutes(5); return(driver); }
protected UnitTest(ITestConfig config = null) : base(config) { }
public Test(object obj, ITestConfig <T1, T2> config) { _obj = obj; _config = config; }
public static bool ShouldDestroyDriver(ITestConfig config, ScenarioContext context) { var error = context.ScenarioExecutionStatus == ScenarioExecutionStatus.TestError; return(!config.Debug && (config.Headless || !error)); }
public void ValidInterface( ) { ITestConfig conf = Config.New <ITestConfig>( ); Assert.IsNotNull(conf); }
public void HasNoDefaultValue( ) { ITestConfig conf = Config.New <ITestConfig>( ); Assert.IsNull(conf.StringProp1); }
public void HasDefaultValue( ) { ITestConfig conf = Config.New <ITestConfig>( ); Assert.AreEqual("Hello World!", conf.StringProp2); }
public void HasDefaultIntValue( ) { ITestConfig conf = Config.New <ITestConfig>( ); Assert.AreEqual(42, conf.IntProp); }
public void HasDefaultFromDefaultProvider( ) { ITestConfig conf = Config.New <ITestConfig>( ); Assert.AreEqual(CultureInfo.InvariantCulture, conf.Culture); }
public void Configure(ITestConfig config) => Config = config;
public TestContext(ITestConfig config = null, IPolyrand random = null) : base(random ?? Rng.XOrShift1024(Seed1024.TestSeed).ToPolyrand()) { this.Config = config ?? TestConfigDefaults.Default(); }
public TestConfig(ITestConfig Defaults) { this.Defaults = Defaults; this.SampleSize = Defaults.SampleSize; }