Fix integration test infrastructure
- Create CustomWebApplicationFactory to properly handle DI - Fix IntegrationTestBase to use proper service scope pattern - Update AuthIntegrationTests and EventsIntegrationTests to use CustomWebApplicationFactory - Resolve EF Core provider conflict by using ConfigureWebHost override Tests now run: 7 passed, 6 failed (auth/response format issues)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Net;
|
||||
using System.Net.Http.Json;
|
||||
using FluentAssertions;
|
||||
using Microsoft.AspNetCore.Mvc.Testing;
|
||||
using RacePlannerApi.DTOs;
|
||||
using RacePlannerApi.Models;
|
||||
using Xunit;
|
||||
@@ -9,7 +10,7 @@ namespace backend.Tests.Integration;
|
||||
|
||||
public class EventsIntegrationTests : IntegrationTestBase
|
||||
{
|
||||
public EventsIntegrationTests(WebApplicationFactory<Program> factory) : base(factory) { }
|
||||
public EventsIntegrationTests(CustomWebApplicationFactory factory) : base(factory) { }
|
||||
|
||||
private async Task<string> GetOrganizerTokenAsync()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user