Adds Presentation Api layer integration tests for file system browser dialog

This commit is contained in:
BinaryAlley committed 2024-10-11 21:03:21 +03:00
1 parent 2550bf8a3f
commit b94c299180
20 files changed
+2414 -24

No files matched your search

@@ -1,4 +1,4 @@
#region ========================================================================= USING =====================================================================================
#region ========================================================================= USING =====================================================================================
using Lumina.DataAccess.Core.UoW;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.Testing;
@@ -8,6 +8,8 @@ using Microsoft.Extensions.DependencyInjection;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Serialization;
#endregion
namespace Lumina.Presentation.Api.IntegrationTests.Common.Setup;
@@ -42,10 +44,13 @@ public class LuminaApiFactory : WebApplicationFactory<Program>, IDisposable
{
builder.ConfigureServices(services =>
{
// remove existing DbContext configuration
ServiceDescriptor? descriptor = services.SingleOrDefault(serviceDescriptor => serviceDescriptor.ServiceType == typeof(DbContextOptions<LuminaDbContext>));
if (descriptor is not null)
services.Remove(descriptor);
// add SQLite DbContext configuration
services.AddDbContext<LuminaDbContext>(options => options.UseSqlite(_connection));
// build service provider and ensure database is created
ServiceProvider servicePreovider = services.BuildServiceProvider();
using (IServiceScope scope = servicePreovider.CreateScope())
{
@@ -65,4 +70,4 @@ public class LuminaApiFactory : WebApplicationFactory<Program>, IDisposable
base.Dispose();
}
#endregion
}
}