2025-03-15 22:02:26 -05:00
|
|
|
using Microsoft.AspNetCore.Mvc.Testing;
|
|
|
|
|
|
2025-03-15 21:00:00 -05:00
|
|
|
namespace LANCommander.Server.Tests;
|
|
|
|
|
|
2025-03-15 23:13:31 -05:00
|
|
|
public class ApplicationFixture : ApplicationFactory<Program>
|
2025-03-15 21:00:00 -05:00
|
|
|
{
|
2025-03-15 22:02:26 -05:00
|
|
|
public static ApplicationFixture Instance;
|
2025-03-15 21:00:00 -05:00
|
|
|
|
2025-03-15 22:02:26 -05:00
|
|
|
public SDK.Client Client { get; set; }
|
2025-03-15 23:13:31 -05:00
|
|
|
public IServiceProvider ServiceProvider { get; set; }
|
2025-03-15 21:00:00 -05:00
|
|
|
|
2025-03-15 23:13:31 -05:00
|
|
|
public ApplicationFixture(ApplicationFactory<Program> factory)
|
2025-03-15 21:00:00 -05:00
|
|
|
{
|
2025-03-15 22:02:26 -05:00
|
|
|
if (Instance != null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Client = new SDK.Client(factory.CreateClient(), "C:\\Games");
|
2025-03-15 23:13:31 -05:00
|
|
|
ServiceProvider = factory.Services;
|
2025-03-15 22:02:26 -05:00
|
|
|
|
|
|
|
|
Instance = this;
|
2025-03-15 21:00:00 -05:00
|
|
|
}
|
2025-03-15 22:02:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[CollectionDefinition("Application")]
|
2025-03-15 23:13:31 -05:00
|
|
|
public class ApplicationCollection : ICollectionFixture<ApplicationFactory<Program>>
|
2025-03-15 22:02:26 -05:00
|
|
|
{
|
|
|
|
|
|
2025-03-15 21:00:00 -05:00
|
|
|
}
|