mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-07-01 11:02:57 +00:00
35 lines
980 B
C#
35 lines
980 B
C#
using System;
|
|
using System.Net.Http;
|
|
using CleanArchitecture.Infrastructure.Database;
|
|
using CleanArchitecture.IntegrationTests.Infrastructure;
|
|
using Microsoft.AspNetCore.Mvc.Testing;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace CleanArchitecture.IntegrationTests.Fixtures;
|
|
|
|
public class TestFixtureBase
|
|
{
|
|
public TestFixtureBase()
|
|
{
|
|
Factory = new CleanArchitectureWebApplicationFactory(
|
|
SeedTestData,
|
|
RegisterCustomServicesHandler);
|
|
|
|
ServerClient = Factory.CreateClient();
|
|
ServerClient.Timeout = TimeSpan.FromMinutes(5);
|
|
}
|
|
|
|
public HttpClient ServerClient { get; }
|
|
protected WebApplicationFactory<Program> Factory { get; }
|
|
|
|
protected virtual void SeedTestData(ApplicationDbContext context)
|
|
{
|
|
}
|
|
|
|
protected virtual void RegisterCustomServicesHandler(
|
|
IServiceCollection services,
|
|
ServiceProvider serviceProvider,
|
|
IServiceProvider scopedServices)
|
|
{
|
|
}
|
|
} |