private static TestBootstrapper CreateBootstrapper() { var bootstrapper = new TestBootstrapper(); bootstrapper.Initialise(); bootstrapper.GetEngine(); return(bootstrapper); }
public void GetEngine_RegistersRequestStartup() { var bootstrapper = new TestBootstrapper(); bootstrapper.Initialise(); var engine = bootstrapper.GetEngine(); engine.HandleRequest(new Request("Post", "Sample", "http")); }
public void GetEngine_ReturnsEngine() { var bootstrapper = new TestBootstrapper(); bootstrapper.Initialise(); var engine = bootstrapper.GetEngine(); Assert.IsNotNull(engine); }
public void GetAllModules_ReturnsModules() { var bootstrapper = new TestBootstrapper(); bootstrapper.Initialise(); bootstrapper.GetEngine(); var modules = bootstrapper.GetAllModules(new NancyContext()); Assert.IsTrue(modules.Any()); }
public void GetModule_ReturnsModule() { var bootstrapper = new TestBootstrapper(); bootstrapper.Initialise(); bootstrapper.GetEngine(); INancyModule module = bootstrapper.GetModule(typeof(SampleModule), new NancyContext()); Assert.IsInstanceOfType(module, typeof(SampleModule)); }
public void GetModule_PerRequestDependency_ReturnsModule() { var bootstrapper = new TestBootstrapper(); bootstrapper.Initialise(); bootstrapper.GetEngine(); var module = (SampleModuleWithPerRequestDependency)bootstrapper.GetModule( typeof(SampleModuleWithPerRequestDependency), new NancyContext()); Assert.IsInstanceOfType(module.PerRequest, typeof(PerRequest)); }
public void GetModule_DisposableTransientDependency_ReturnsModule() { var bootstrapper = new TestBootstrapper(); bootstrapper.Initialise(); bootstrapper.GetEngine(); var module = (SampleModuleWithDisposableTransientDependency)bootstrapper.GetModule( typeof(SampleModuleWithDisposableTransientDependency), new NancyContext()); Assert.IsType(typeof(DisposableTransient), module.Transient); }