diff --git a/test/unittests/Microsoft.ServiceFabric.AspNetCore.Tests/Microsoft.ServiceFabric.AspNetCore.Tests.csproj b/test/unittests/Microsoft.ServiceFabric.AspNetCore.Tests/Microsoft.ServiceFabric.AspNetCore.Tests.csproj index b27a971..9dd7f3f 100644 --- a/test/unittests/Microsoft.ServiceFabric.AspNetCore.Tests/Microsoft.ServiceFabric.AspNetCore.Tests.csproj +++ b/test/unittests/Microsoft.ServiceFabric.AspNetCore.Tests/Microsoft.ServiceFabric.AspNetCore.Tests.csproj @@ -10,12 +10,12 @@ - + - - - - + + + + all runtime; build; native; contentfiles; analyzers diff --git a/test/unittests/Microsoft.ServiceFabric.AspNetCore.Tests/ServiceFabricMiddlewareTests.cs b/test/unittests/Microsoft.ServiceFabric.AspNetCore.Tests/ServiceFabricMiddlewareTests.cs index 0f4528a..82810f3 100644 --- a/test/unittests/Microsoft.ServiceFabric.AspNetCore.Tests/ServiceFabricMiddlewareTests.cs +++ b/test/unittests/Microsoft.ServiceFabric.AspNetCore.Tests/ServiceFabricMiddlewareTests.cs @@ -69,9 +69,10 @@ public static IEnumerable HostTypes /// when constructing url before returning to Naming Service. /// /// The type of host used to create the listener. + /// A tracking asynchronous test completion. [Theory] [MemberData(nameof(HostTypes))] - public void VerifyReturnCode410(string hostType) + public async Task VerifyReturnCode410(string hostType) { var nextCalled = false; @@ -86,7 +87,7 @@ public void VerifyReturnCode410(string hostType) // send a request in which Path is different than urlSuffix this.httpContext.Request.Path = this.listener.UrlSuffix + "xyz"; - middleware.Invoke(this.httpContext).GetAwaiter().GetResult(); + await middleware.Invoke(this.httpContext); this.httpContext.Response.StatusCode.Should().Be(StatusCodes.Status410Gone, "status code should be 410 when path base is different from url suffix."); nextCalled.Should().BeFalse("next RequestDelegate is not called by middleware.");