diff --git a/tests/LinkDotNet.Blog.IntegrationTests/SmokeTests.cs b/tests/LinkDotNet.Blog.IntegrationTests/SmokeTests.cs index 0acab172..dcb13bf2 100644 --- a/tests/LinkDotNet.Blog.IntegrationTests/SmokeTests.cs +++ b/tests/LinkDotNet.Blog.IntegrationTests/SmokeTests.cs @@ -6,7 +6,7 @@ namespace LinkDotNet.Blog.IntegrationTests; -public sealed class SmokeTests : IClassFixture> +public sealed class SmokeTests : IClassFixture>, IDisposable { private readonly WebApplicationFactory factory; @@ -17,11 +17,13 @@ public SmokeTests(WebApplicationFactory factory) builder.UseSetting("PersistenceProvider", PersistenceProvider.InMemory.Key); }); } + + public void Dispose() => factory.Dispose(); [Fact] public async Task ShouldBootUpApplication() { - var client = factory.CreateClient(); + using var client = factory.CreateClient(); var result = await client.GetAsync("/"); @@ -31,7 +33,7 @@ public async Task ShouldBootUpApplication() [Fact] public async Task ShouldBootUpWithSqlDatabase() { - var client = factory.WithWebHostBuilder(builder => + using var client = factory.WithWebHostBuilder(builder => { builder.UseSetting("PersistenceProvider", PersistenceProvider.Sqlite.Key); builder.UseSetting("ConnectionString", "DataSource=file::memory:?cache=shared"); @@ -45,7 +47,7 @@ public async Task ShouldBootUpWithSqlDatabase() [Fact] public async Task ShouldAllowDotsForTagSearch() { - var client = factory.CreateClient(); + using var client = factory.CreateClient(); var result = await client.GetAsync("/searchByTag/.NET5"); @@ -55,7 +57,7 @@ public async Task ShouldAllowDotsForTagSearch() [Fact] public async Task ShouldAllowDotsForFreeTextSearch() { - var client = factory.CreateClient(); + using var client = factory.CreateClient(); var result = await client.GetAsync("/search/.NET5");