public Runner() { _sender = JasperAlba.For <SenderApp>(app => { app.Hosting.ConfigureAppConfiguration((_, config) => { config.AddInMemoryCollection(new Dictionary <string, string> { { "marten", "Host=localhost;Port=5433;Database=postgres;Username=postgres;password=postgres" }, { "receiver", "tcp://localhost:2222/durable" }, { "listener", "tcp://localhost:2333/durable" } }); }); }); //_sender.Get<IDocumentStore>().Tenancy.Default.EnsureStorageExists(typeof(Envelope)); //_sender.Get<IDocumentStore>().Tenancy.Default.EnsureStorageExists(typeof(SentTrack)); //_sender.Get<IDocumentStore>().Tenancy.Default.EnsureStorageExists(typeof(ReceivedTrack)); _receiver = JasperAlba.For <ReceiverApp>(app => { app.Hosting.ConfigureAppConfiguration((_, config) => { config.AddInMemoryCollection(new Dictionary <string, string> { { "marten", "Host=localhost;Port=5433;Database=postgres;Username=postgres;password=postgres" }, { "listener", "tcp://localhost:2222/durable" } }); }); }); //_receiver.Get<IDocumentStore>().Tenancy.Default.EnsureStorageExists(typeof(Envelope)); //_receiver.Get<IDocumentStore>().Tenancy.Default.EnsureStorageExists(typeof(SentTrack)); //_receiver.Get<IDocumentStore>().Tenancy.Default.EnsureStorageExists(typeof(ReceivedTrack)); }
private async Task <IScenarioResult> scenario(Action <Scenario> configure) { theRegistry.Handlers.DisableConventionalDiscovery(); if (_host == null) { _host = JasperAlba.For(theRegistry); } return(await _host.Scenario(configure)); }
public async Task can_delegate_to_mvc_route_through_Kestrel() { using (var theRuntime = JasperAlba.For <JasperServerApp>()) { await theRuntime.Scenario(x => { x.Get.Url("/values/5"); x.ContentShouldContain("5"); }); } }
public async Task find_what_is_wrong() { var registry = new JasperRegistry(); registry.HttpRoutes.DisableConventionalDiscovery().IncludeType <FakeThing>(); using (var system = JasperAlba.For(registry)) { await system.Scenario(x => x.Get.Url("/chars/a/to/c")); } }
public async Task sample_alba_spec() { using (var runtime = JasperAlba.ForBasic()) { await runtime.Scenario(x => { x.Get.Url("/salutations"); x.StatusCodeShouldBeOk(); x.ContentShouldBe("Greetings and salutations"); x.ContentTypeShouldBe("text/plain"); }); } }
public HttpPipelineBenchmark() { _runtime = JasperAlba.For <Receiver1>(); var directory = AppContext.BaseDirectory; while (!File.Exists(directory.AppendPath("target.json"))) { directory = directory.ParentDirectory(); } _json = new FileSystem().ReadStringFromFile(directory.AppendPath("target.json")); }
public async Task will_still_apply_middleware() { var runtime = JasperAlba.For <JasperRegistry>(_ => { _.HttpRoutes.DisableConventionalDiscovery(); _.Hosting.Configure(app => { app.Run(c => c.Response.WriteAsync("Hello")); }); }); try { await runtime.Scenario(s => { s.Get.Url("/"); s.ContentShouldBe("Hello"); }); } finally { runtime.Dispose(); } }
public ApplicationFixture() { // Your application setup here would probably // refer to a JasperRegistry for your application Runtime = JasperAlba.ForBasic(); }