Skip to content

Commit

Permalink
refactor: Dispose in smoke tests
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Feb 23, 2024
1 parent 6315641 commit 3576cac
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/LinkDotNet.Blog.IntegrationTests/SmokeTests.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System.Threading.Tasks;
using System;
using System.Threading.Tasks;
using LinkDotNet.Blog.Infrastructure.Persistence;
using LinkDotNet.Blog.Web;
using Microsoft.AspNetCore.Mvc.Testing;

namespace LinkDotNet.Blog.IntegrationTests;

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

Expand Down Expand Up @@ -60,4 +61,14 @@ public async Task ShouldAllowDotsForFreeTextSearch()

result.IsSuccessStatusCode.Should().BeTrue();
}

public async ValueTask DisposeAsync()
{
if (factory != null)
{
await factory.DisposeAsync();
}
}

public void Dispose() => factory?.Dispose();
}

0 comments on commit 3576cac

Please sign in to comment.