Skip to content

Commit

Permalink
Readded Dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Jun 27, 2024
1 parent 1ccc102 commit b3f0178
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/LinkDotNet.Blog.IntegrationTests/SmokeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace LinkDotNet.Blog.IntegrationTests;

public sealed class SmokeTests : IClassFixture<WebApplicationFactory<Program>>
public sealed class SmokeTests : IClassFixture<WebApplicationFactory<Program>>, IDisposable
{
private readonly WebApplicationFactory<Program> factory;

Expand All @@ -17,11 +17,13 @@ public SmokeTests(WebApplicationFactory<Program> 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("/");

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

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

Expand Down

0 comments on commit b3f0178

Please sign in to comment.