Skip to content

Commit

Permalink
Upgrade test package dependencies (#119)
Browse files Browse the repository at this point in the history
* Update test dependencies
* Make ServiceFabricMiddlewareTests.VerifyReturnCode410 use await instead of GetAwayter()
  • Loading branch information
olegsych committed May 29, 2024
1 parent 89f71c5 commit b3870be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="FluentAssertions" Version="5.9.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="$(NugetPkg_Version_Microsoft_ServiceFabric_Services)" />
<PackageReference Include="Moq" Version="4.13.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ public static IEnumerable<object[]> HostTypes
/// when constructing url before returning to Naming Service.
/// </summary>
/// <param name="hostType">The type of host used to create the listener.</param>
/// <returns>A <see cref="Task"/> tracking asynchronous test completion.</returns>
[Theory]
[MemberData(nameof(HostTypes))]
public void VerifyReturnCode410(string hostType)
public async Task VerifyReturnCode410(string hostType)
{
var nextCalled = false;

Expand All @@ -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.");
Expand Down

0 comments on commit b3870be

Please sign in to comment.