Ejemplo n.º 1
0
 public void HttpServerReturnsValidPage(String page)
 {
     using (var service = new HttpDiagnosticsService())
     {
         service.Start();
         Assert.That(StatusOfPage(page, service.Port), Is.EqualTo(WebExceptionStatus.Success));
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a module and prepares it to handle requests.
 /// </summary>
 /// <param name="context">An <see cref="T:System.Web.HttpApplication"/> that provides access to the methods, properties, and events common to all application objects within an ASP.NET application</param>
 public void Init(HttpApplication context)
 {
     var key = typeof(HttpDiagnosticsService).FullName + ".port";
     int port;
     if (!ConfigurationManager.AppSettings.AllKeys.Contains(key) || !Int32.TryParse(ConfigurationManager.AppSettings[key], out port))
     {
         throw new InvalidOperationException("You must have an AppSetting of '" + key +
                                             "' that specifies the port " +
                                             " for the diagnostics service to use");
     }
     diagnosticsService = new HttpDiagnosticsService(port);
     diagnosticsService.Start();
     context.BeginRequest += BeginRequest;
     context.EndRequest += EndRequest;
 }
Ejemplo n.º 3
0
 public void HtppServiceStarts()
 {
     using (var service = new HttpDiagnosticsService())
         service.Start();
 }