31 lines
760 B
C#
31 lines
760 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Persistence.Database.Model;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Xunit;
|
|
|
|
namespace Persistence.IntegrationTests;
|
|
public abstract class BaseIntegrationTest : IClassFixture<WebAppFactoryFixture>,
|
|
IDisposable
|
|
{
|
|
protected readonly IServiceScope scope;
|
|
|
|
protected readonly PersistenceDbContext dbContext;
|
|
|
|
protected BaseIntegrationTest(WebAppFactoryFixture factory)
|
|
{
|
|
scope = factory.Services.CreateScope();
|
|
|
|
dbContext = scope.ServiceProvider.GetRequiredService<PersistenceDbContext>();
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
scope.Dispose();
|
|
dbContext.Dispose();
|
|
}
|
|
}
|