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); }