Skip to content

Commit

Permalink
Dispose the test host to prevent test runner to deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
mauroservienti committed Apr 1, 2021
1 parent 614d889 commit 31f659d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public Task Handle(HttpRequest request)
public async Task Startup_should_not_fail()
{
// Arrange
var client = new SelfContainedWebApplicationFactoryWithHost<Dummy>
using var webApp = new SelfContainedWebApplicationFactoryWithHost<Dummy>
(
configureServices: services =>
{
Expand All @@ -55,7 +55,9 @@ public async Task Startup_should_not_fail()
options.ValidateOnBuild = true;
});
}
}.CreateClient();
};

var client = webApp.CreateClient();

// Act
var response = await client.GetAsync("/empty-response/1");
Expand Down

0 comments on commit 31f659d

Please sign in to comment.