protected RequestSpec() { var defaultNancyBootstrapper = new DefaultNancyBootstrapper(); defaultNancyBootstrapper.Initialise(); engine = defaultNancyBootstrapper.GetEngine(); }
static void Main(string[] args) { var bootstrapper = new DefaultNancyBootstrapper(); bootstrapper.Initialise(); var host = new NancyHost(bootstrapper, new Uri("http://127.0.0.1:8080")); host.Start(); Console.ReadLine(); }
public void GetModule_WithPerRequestCollectionTypeDependency_ReturnsDifferentDependencies() { var bootstrapper = new DefaultNancyBootstrapper(); bootstrapper.Initialise(); bootstrapper.GetEngine(); //var bootstrapper = CreateBootstrapper(); var firstModule = (SampleModuleWithPerRequestCollectionDependency)bootstrapper.GetModule( typeof(SampleModuleWithPerRequestCollectionDependency), new NancyContext()); var secondModule = (SampleModuleWithPerRequestCollectionDependency)bootstrapper.GetModule( typeof(SampleModuleWithPerRequestCollectionDependency), new NancyContext()); Assert.IsTrue(firstModule.Instances.SequenceEqual(secondModule.Instances)); Assert.AreEqual(firstModule.Instances.First(), secondModule.Instances.First()); }