static void Main(string[] args) { // Create the application host object host = ApplicationHost.CreateApplicationHost(typeof(MyHost), "/", "c:\\"); int request_count = 10; SimpleWorkerRequest [] requests = new SimpleWorkerRequest[request_count]; int pos; for (pos = 0; pos != request_count; pos++) { requests[pos] = new SimpleWorkerRequest("test.aspx", "", Console.Out); } ModulesConfiguration.Add("syncmodule", typeof(SyncModule).AssemblyQualifiedName); ModulesConfiguration.Add("asyncmodule", typeof(AsyncModule).AssemblyQualifiedName); HandlerFactoryConfiguration.Add("get", "/", typeof(AsyncHandler).AssemblyQualifiedName); //HandlerFactoryConfiguration.Add("get", "/", typeof(SyncHandler).AssemblyQualifiedName); for (pos = 0; pos != request_count; pos++) { HttpRuntime.ProcessRequest(requests[pos]); } HttpRuntime.Close(); /* * Console.Write("Press Enter to quit."); * Console.WriteLine(); * Console.ReadLine(); */ }
public void ShouldGetConfigurationByInterfaces_WhenAddedConfigurationImplementation() { var config = new TestConfiguration(); _configuration.Add(config); Assert.Equal(config, _configuration.Get <IFirstConfiguration>()); Assert.Equal(config, _configuration.Get <ISecondConfiguration>()); }