Reacting to hosting test server changes

This commit is contained in:
John Luo 2015-12-01 15:47:25 -08:00
parent 5d5f278824
commit 208f0f8a58
2 changed files with 8 additions and 0 deletions

View File

@ -9,6 +9,7 @@ using System.Linq;
using System.Reflection;
using System.Runtime.Versioning;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.FileProviders;
@ -497,6 +498,9 @@ namespace Microsoft.AspNet.Diagnostics
// Act
await server.CreateClient().GetAsync("/path");
// This ensures that all diagnostics are completely written to the diagnostic listener
Thread.Sleep(1000);
// Assert
Assert.NotNull(listener.EndRequest?.HttpContext);
Assert.Null(listener.HostingUnhandledException?.HttpContext);

View File

@ -7,6 +7,7 @@ using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
@ -354,6 +355,9 @@ namespace Microsoft.AspNet.Diagnostics
// Act
await server.CreateClient().GetAsync(string.Empty);
// This ensures that all diagnostics are completely written to the diagnostic listener
Thread.Sleep(1000);
// Assert
Assert.NotNull(listener.EndRequest?.HttpContext);
Assert.Null(listener.HostingUnhandledException?.HttpContext);