2023-12-29 11:46:17 +05:00
|
|
|
using System.Net.Http.Headers;
|
|
|
|
using System.Text.Json;
|
|
|
|
using AsbCloudDb.Model;
|
|
|
|
using AsbCloudWebApi.IntegrationTests.Clients;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Refit;
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
namespace AsbCloudWebApi.IntegrationTests;
|
|
|
|
|
|
|
|
public abstract class BaseIntegrationTest : IClassFixture<WebAppFactoryFixture>
|
|
|
|
{
|
2024-01-19 17:49:09 +05:00
|
|
|
protected readonly IServiceScope scope;
|
2023-12-29 11:46:17 +05:00
|
|
|
protected readonly IAsbCloudDbContext dbContext;
|
2024-01-19 17:49:09 +05:00
|
|
|
protected readonly WebAppFactoryFixture factory;
|
2023-12-29 11:46:17 +05:00
|
|
|
|
2024-01-19 17:49:09 +05:00
|
|
|
protected BaseIntegrationTest(WebAppFactoryFixture factory)
|
2023-12-29 11:46:17 +05:00
|
|
|
{
|
|
|
|
scope = factory.Services.CreateScope();
|
|
|
|
dbContext = scope.ServiceProvider.GetRequiredService<IAsbCloudDbContext>();
|
2024-01-19 17:49:09 +05:00
|
|
|
this.factory = factory;
|
|
|
|
}
|
2023-12-29 11:46:17 +05:00
|
|
|
}
|