public void create_a_context_without_warmup_without_failure() { using (var system = new SerenitySystem()) { system.As <ISystem>().CreateContext().ShouldBeOfType <SerenitySystem.SerenityContext>(); } }
public void warmup_will_create_a_fuburuntime() { using (var system = new SerenitySystem()) { system.As <ISystem>().Warmup().Wait(); system.Runtime.ShouldNotBeNull(); } }
public void add_an_application() { var system = new SerenitySystem(); system.AddApplication(new Foo()); var app = system.Applications.PrimaryApplication(); app.ShouldNotBeNull(); app.Name.ShouldEqual("Foo"); }
public void the_build_runtime_will_be_in_testing_mode() { using (var system = new SerenitySystem()) { system.As <ISystem>().Warmup().Wait(); system.Runtime.Mode.InTesting().ShouldBeTrue(); } }
public void build_for_a_system_all_defaults() { Project.CurrentProject = new Project { Profile = null }; using (var system = new SerenitySystem()) { system.As<ISystem>().Warmup().Wait(); system.Runtime.Get<IBrowserLifecycle>() .ShouldBeOfType<ChromeBrowser>(); } }
public void build_for_a_system_with_default() { Project.CurrentProject = new Project { Profile = null }; using (var system = new SerenitySystem{DefaultBrowser = BrowserType.Firefox}) { system.As<ISystem>().Warmup().Wait(); system.Runtime.Get<IBrowserLifecycle>() .ShouldBeOfType<FirefoxBrowser>(); } }
public void build_with_system_for_profile() { Project.CurrentProject = new Project { Profile = "phantom/katana" }; using (var system = new SerenitySystem { DefaultBrowser = BrowserType.Firefox }) { system.As<ISystem>().Warmup().Wait(); system.Runtime.Get<IBrowserLifecycle>() .ShouldBeOfType<PhantomBrowser>(); } }
public void register_services_puts_both_the_serenity_applications_and_primary_app_in() { var system = new SerenitySystem(); system.AddApplication<Foo>(); system.AddApplication<Bar>(); var context = new TestContext(); system.RegisterServices(context); context.Retrieve<IApplicationUnderTest>().Name.ShouldEqual("Foo"); context.Retrieve<SerenityApplications>().ShouldBeTheSameAs(system.Applications); }
public void security_settings_are_reset_on_each_test_run() { using (var system = new SerenitySystem()) { system.As <ISystem>().CreateContext(); system.Runtime.Get <SecuritySettings>().AuthenticationEnabled = false; // okay, now create a new context and the settings should go back to everything // being enabled system.As <ISystem>().CreateContext(); system.Runtime.Get <SecuritySettings>().AuthenticationEnabled.ShouldBeTrue(); } }
public void build_for_a_system_all_defaults() { Project.CurrentProject = new Project { Profile = null }; using (var system = new SerenitySystem()) { system.As <ISystem>().Warmup().Wait(); system.Runtime.Get <IBrowserLifecycle>() .ShouldBeOfType <ChromeBrowser>(); } }
public void register_services_puts_both_the_serenity_applications_and_primary_app_in() { var system = new SerenitySystem(); system.AddApplication <Foo>(); system.AddApplication <Bar>(); var context = new TestContext(); system.RegisterServices(context); context.Retrieve <IApplicationUnderTest>().Name.ShouldEqual("Foo"); context.Retrieve <SerenityApplications>().ShouldBeTheSameAs(system.Applications); }
public void build_with_system_for_profile() { Project.CurrentProject = new Project { Profile = "phantom/katana" }; using (var system = new SerenitySystem { DefaultBrowser = BrowserType.Firefox }) { system.As <ISystem>().Warmup().Wait(); system.Runtime.Get <IBrowserLifecycle>() .ShouldBeOfType <PhantomBrowser>(); } }
public void build_for_a_system_with_default() { Project.CurrentProject = new Project { Profile = null }; using (var system = new SerenitySystem { DefaultBrowser = BrowserType.Firefox }) { system.As <ISystem>().Warmup().Wait(); system.Runtime.Get <IBrowserLifecycle>() .ShouldBeOfType <FirefoxBrowser>(); } }
public SystemModule() { Get["/system"] = _ => { var system = new SerenitySystem() { Id = GuidUtil.GetDeterministicGuid(NetworkUtil.GetSystemMacAddress()).ToString(), }; system.Links.Add(Constants.Rels.DEVICE, new Uri("/system/local", UriKind.Relative)); system.Links.Add(Constants.Rels.DEVICES, new Uri("/system/devices", UriKind.Relative)); system.Links.Add(Constants.Rels.DATASOURCES, new Uri("/system/datasources", UriKind.Relative)); var response = Response.AsJson(system); response.ContentType = Constants.ContentTypes.SERENITY_RESOURCE; return(response); }; }
public void create_a_context_without_warmup_without_failure() { using (var system = new SerenitySystem()) { system.As<ISystem>().CreateContext().ShouldBeOfType<SerenitySystem.SerenityContext>(); } }
public void security_settings_are_reset_on_each_test_run() { using (var system = new SerenitySystem()) { system.As<ISystem>().CreateContext(); system.Runtime.Get<SecuritySettings>().AuthenticationEnabled = false; // okay, now create a new context and the settings should go back to everything // being enabled system.As<ISystem>().CreateContext(); system.Runtime.Get<SecuritySettings>().AuthenticationEnabled.ShouldBeTrue(); } }
public void the_build_runtime_will_be_in_testing_mode() { using (var system = new SerenitySystem()) { system.As<ISystem>().Warmup().Wait(); system.Runtime.Mode.InTesting().ShouldBeTrue(); } }
public void warmup_will_create_a_fuburuntime() { using (var system = new SerenitySystem()) { system.As<ISystem>().Warmup().Wait(); system.Runtime.ShouldNotBeNull(); } }