mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-07-01 02:52:56 +00:00
36 lines
997 B
C#
36 lines
997 B
C#
using System;
|
|
using System.IO;
|
|
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)
|
|
{
|
|
}
|
|
} |