Renames project content from Lumina to Nemera

This commit is contained in:
BinaryAlley committed 2026-11-27 15:37:44 +02:00
1 parent 0f659a4877
commit c583c9327c
6127 files changed
+41884 -41884

No files matched your search

@@ -1,14 +1,14 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.UsersManagement;
using Lumina.Application.Common.DataAccess.Seed;
using Lumina.Application.Fixtures.Common.DataAccess.Entities.Authorization;
using Lumina.Application.Fixtures.Common.DataAccess.Entities.UsersManagement;
using Lumina.Contracts.Fixtures.Core.Requests.Authentication;
using Lumina.Contracts.Requests.Authentication;
using Lumina.Contracts.Responses.Authentication;
using Lumina.DataAccess.Core.UoW;
using Lumina.Domain.SharedKernel.Common.Enums.Authorization;
using Lumina.Infrastructure.Core.Security;
using Nemera.Application.Common.DataAccess.Entities.UsersManagement;
using Nemera.Application.Common.DataAccess.Seed;
using Nemera.Application.Fixtures.Common.DataAccess.Entities.Authorization;
using Nemera.Application.Fixtures.Common.DataAccess.Entities.UsersManagement;
using Nemera.Contracts.Fixtures.Core.Requests.Authentication;
using Nemera.Contracts.Requests.Authentication;
using Nemera.Contracts.Responses.Authentication;
using Nemera.DataAccess.Core.UoW;
using Nemera.Domain.SharedKernel.Common.Enums.Authorization;
using Nemera.Infrastructure.Core.Security;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Diagnostics.CodeAnalysis;
@@ -21,13 +21,13 @@ using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Api.IntegrationTests.Common.Setup;
namespace Nemera.Presentation.Api.IntegrationTests.Common.Setup;
// <summary>
/// Factory that extends <see cref="LuminaApiFactory"/> to provide authenticated HTTP clients for testing.
/// Factory that extends <see cref="NemeraApiFactory"/> to provide authenticated HTTP clients for testing.
/// </summary>
[ExcludeFromCodeCoverage]
public class AuthenticatedLuminaApiFactory : LuminaApiFactory, IDisposable
public class AuthenticatedNemeraApiFactory : NemeraApiFactory, IDisposable
{
private readonly PasswordHashService _hashService = new();
private readonly JsonSerializerOptions _jsonOptions = new()
@@ -72,7 +72,7 @@ public class AuthenticatedLuminaApiFactory : LuminaApiFactory, IDisposable
private async Task<UserEntity> CreateAndAuthenticateUser(HttpClient client, AuthorizationPermission[] permissions)
{
using IServiceScope scope = Services.CreateScope();
LuminaDbContext dbContext = scope.ServiceProvider.GetRequiredService<LuminaDbContext>();
NemeraDbContext dbContext = scope.ServiceProvider.GetRequiredService<NemeraDbContext>();
// Create test user, with the permissions granted directly to it.
UserEntity user = _userEntityFixture.Create(username: TestUsername!, password: _hashService.HashString("TestPass123!"));
@@ -127,7 +127,7 @@ public class AuthenticatedLuminaApiFactory : LuminaApiFactory, IDisposable
private async Task<UserEntity> CreateAndAuthenticateAdminUser(HttpClient client)
{
using IServiceScope scope = Services.CreateScope();
LuminaDbContext dbContext = scope.ServiceProvider.GetRequiredService<LuminaDbContext>();
NemeraDbContext dbContext = scope.ServiceProvider.GetRequiredService<NemeraDbContext>();
IDataSeedService dataSeedService = scope.ServiceProvider.GetRequiredService<IDataSeedService>();
// Create test user.
@@ -176,7 +176,7 @@ public class AuthenticatedLuminaApiFactory : LuminaApiFactory, IDisposable
public async Task RemoveTestUserAsync()
{
using IServiceScope scope = Services.CreateScope();
LuminaDbContext dbContext = scope.ServiceProvider.GetRequiredService<LuminaDbContext>();
NemeraDbContext dbContext = scope.ServiceProvider.GetRequiredService<NemeraDbContext>();
UserEntity? user = dbContext.Users.FirstOrDefault(u => u.Username == TestUsername);
if (user is not null)
@@ -196,7 +196,7 @@ public class AuthenticatedLuminaApiFactory : LuminaApiFactory, IDisposable
public new void Dispose()
{
using IServiceScope scope = Services.CreateScope();
LuminaDbContext dbContext = scope.ServiceProvider.GetRequiredService<LuminaDbContext>();
NemeraDbContext dbContext = scope.ServiceProvider.GetRequiredService<NemeraDbContext>();
UserEntity? user = dbContext.Users.FirstOrDefault(u => u.Username == TestUsername);
if (user is not null)
@@ -5,7 +5,7 @@ using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Api.IntegrationTests.Common.Setup;
namespace Nemera.Presentation.Api.IntegrationTests.Common.Setup;
/// <summary>
/// Observes the domain events published through the real domain event publisher.
@@ -6,7 +6,7 @@ using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Api.IntegrationTests.Common.Setup;
namespace Nemera.Presentation.Api.IntegrationTests.Common.Setup;
/// <summary>
/// Controls and observes the domain events handled through the <see cref="ProbingDomainEventsQueue"/>.
@@ -1,7 +1,7 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DomainEvents;
using Lumina.Domain.Common.Events;
using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.FavoriteAggregate.Events;
using Nemera.Application.Common.DomainEvents;
using Nemera.Domain.Common.Events;
using Nemera.Domain.Core.BoundedContexts.FavoriteBoundedContext.FavoriteAggregate.Events;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
@@ -10,13 +10,13 @@ using System;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Api.IntegrationTests.Common.Setup;
namespace Nemera.Presentation.Api.IntegrationTests.Common.Setup;
/// <summary>
/// Authenticated API factory whose database transactions and domain events are observable through probes.
/// </summary>
[ExcludeFromCodeCoverage]
public sealed class EventualConsistencyApiFactory : AuthenticatedLuminaApiFactory
public sealed class EventualConsistencyApiFactory : AuthenticatedNemeraApiFactory
{
/// <summary>
/// Gets the probe that controls and observes the domain events queue.
@@ -1,6 +1,6 @@
#region ========================================================================= USING =====================================================================================
using Lumina.DataAccess.Common.Interceptors;
using Lumina.DataAccess.Core.UoW;
using Nemera.DataAccess.Common.Interceptors;
using Nemera.DataAccess.Core.UoW;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.Testing;
@@ -17,26 +17,26 @@ using System.Text;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Api.IntegrationTests.Common.Setup;
namespace Nemera.Presentation.Api.IntegrationTests.Common.Setup;
/// <summary>
/// Factory for creating a web application for integration tests.
/// </summary>
[ExcludeFromCodeCoverage]
public class LuminaApiFactory : WebApplicationFactory<Program>, IDisposable
public class NemeraApiFactory : WebApplicationFactory<Program>, IDisposable
{
private readonly SqliteConnection _connection;
private readonly string _sharedInMemoryConnectionString;
private const string TEST_ENCRYPTION_KEY = "MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=";
private const string SHARED_IN_MEMORY_CONNECTION_STRING_PREFIX = "Data Source=lumina-tests-{0};Mode=Memory;Cache=Shared";
private const string SHARED_IN_MEMORY_CONNECTION_STRING_PREFIX = "Data Source=nemera-tests-{0};Mode=Memory;Cache=Shared";
private static byte s_IpClass = 25;
public static byte IpClass => s_IpClass++;
/// <summary>
/// Initializes a new instance of the <see cref="LuminaApiFactory"/> class.
/// Initializes a new instance of the <see cref="NemeraApiFactory"/> class.
/// </summary>
public LuminaApiFactory()
public NemeraApiFactory()
{
// Each factory gets its own uniquely named shared in-memory database, so that parallel test classes remain isolated from one another;
// the shared cache allows each DbContext to open its own pooled connection to the same database, instead of sharing a single connection,
@@ -76,11 +76,11 @@ public class LuminaApiFactory : WebApplicationFactory<Program>, IDisposable
builder.ConfigureServices(services =>
{
// Remove existing DbContext configuration.
ServiceDescriptor? descriptor = services.SingleOrDefault(serviceDescriptor => serviceDescriptor.ServiceType == typeof(DbContextOptions<LuminaDbContext>));
ServiceDescriptor? descriptor = services.SingleOrDefault(serviceDescriptor => serviceDescriptor.ServiceType == typeof(DbContextOptions<NemeraDbContext>));
if (descriptor is not null)
services.Remove(descriptor);
// Add SQLite DbContext configuration.
services.AddDbContext<LuminaDbContext>((serviceProvider, options) =>
services.AddDbContext<NemeraDbContext>((serviceProvider, options) =>
{
options.UseSqlite(_sharedInMemoryConnectionString);
options.AddInterceptors(serviceProvider.GetRequiredService<UpdateAuditableEntitiesInterceptor>());
@@ -105,7 +105,7 @@ public class LuminaApiFactory : WebApplicationFactory<Program>, IDisposable
using (IServiceScope scope = servicePreovider.CreateScope())
{
IServiceProvider scopedServices = scope.ServiceProvider;
LuminaDbContext dbContext = scopedServices.GetRequiredService<LuminaDbContext>();
NemeraDbContext dbContext = scopedServices.GetRequiredService<NemeraDbContext>();
dbContext.Database.Migrate();
}
});
@@ -132,7 +132,7 @@ public class LuminaApiFactory : WebApplicationFactory<Program>, IDisposable
public async Task ResetDatabaseAsync()
{
using IServiceScope scope = Services.CreateScope();
LuminaDbContext context = scope.ServiceProvider.GetRequiredService<LuminaDbContext>();
NemeraDbContext context = scope.ServiceProvider.GetRequiredService<NemeraDbContext>();
context.Books.RemoveRange(context.Books);
context.Libraries.RemoveRange(context.Libraries);
@@ -1,12 +1,12 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DomainEvents;
using Lumina.Domain.Common.Events;
using Nemera.Application.Common.DomainEvents;
using Nemera.Domain.Common.Events;
using Microsoft.AspNetCore.Http;
using System.Collections.Concurrent;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Api.IntegrationTests.Common.Setup;
namespace Nemera.Presentation.Api.IntegrationTests.Common.Setup;
/// <summary>
/// Domain events queue that exposes its enqueuing and dequeuing to a <see cref="DomainEventsQueueProbe"/>.
@@ -1,7 +1,7 @@
#region ========================================================================= USING =====================================================================================
using Lumina.DataAccess.Core.UoW;
using Lumina.Domain.Common.Events;
using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.FavoriteAggregate.Events;
using Nemera.DataAccess.Core.UoW;
using Nemera.Domain.Common.Events;
using Nemera.Domain.Core.BoundedContexts.FavoriteBoundedContext.FavoriteAggregate.Events;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using System.Diagnostics.CodeAnalysis;
@@ -9,7 +9,7 @@ using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Api.IntegrationTests.Common.Setup;
namespace Nemera.Presentation.Api.IntegrationTests.Common.Setup;
/// <summary>
/// Domain event handler that records the publication of a <see cref="FavoriteAddedDomainEvent"/>, together with the state visible at publication time.
@@ -41,7 +41,7 @@ public sealed class RecordingFavoriteAddedDomainEventHandler : IDomainEventHandl
{
// A separate scope and context prove that the row is visible to other connections, which is only true after the request transaction was committed.
using IServiceScope scope = _scopeFactory.CreateScope();
LuminaDbContext dbContext = scope.ServiceProvider.GetRequiredService<LuminaDbContext>();
NemeraDbContext dbContext = scope.ServiceProvider.GetRequiredService<NemeraDbContext>();
bool wasFavoriteVisible = await dbContext.Favorites
.AsNoTracking()
.AnyAsync(favorite => favorite.Id == domainEvent.FavoriteId.Value, cancellationToken).ConfigureAwait(false);
@@ -1,13 +1,13 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Contracts.Fixtures.Core.Responses.FileSystemManagement.Common;
using Lumina.Presentation.Api.Fixtures.Core.Endpoints.FileSystemManagement;
using Nemera.Contracts.Fixtures.Core.Responses.FileSystemManagement.Common;
using Nemera.Presentation.Api.Fixtures.Core.Endpoints.FileSystemManagement;
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using Xunit;
#endregion
namespace Lumina.Presentation.Api.IntegrationTests.Common.Setup;
namespace Nemera.Presentation.Api.IntegrationTests.Common.Setup;
/// <summary>
/// Marks a test to be skipped when the file system does not support the <see cref="FileAttributes.Hidden"/> attribute.
@@ -1,5 +1,5 @@
#region ========================================================================= USING =====================================================================================
using Lumina.DataAccess.Core.UoW;
using Nemera.DataAccess.Core.UoW;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using System.Diagnostics.CodeAnalysis;
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
using Xunit;
#endregion
namespace Lumina.Presentation.Api.IntegrationTests.Common.Setup;
namespace Nemera.Presentation.Api.IntegrationTests.Common.Setup;
/// <summary>
/// Helpers shared by the theme integration tests.
@@ -17,11 +17,11 @@ namespace Lumina.Presentation.Api.IntegrationTests.Common.Setup;
public static class ThemeTestHelpers
{
/// <summary>
/// Waits until the bundled 'lumina-default' theme has been installed and activated by the theme detection job at startup.
/// Waits until the bundled 'nemera-default' theme has been installed and activated by the theme detection job at startup.
/// </summary>
/// <param name="apiFactory">The shared API factory whose database is polled.</param>
/// <returns>A task representing the asynchronous operation.</returns>
public static async Task WaitForBundledThemeAsync(AuthenticatedLuminaApiFactory apiFactory)
public static async Task WaitForBundledThemeAsync(AuthenticatedNemeraApiFactory apiFactory)
{
const int MAX_ATTEMPTS = 100;
const int DELAY_MILLISECONDS = 100;
@@ -29,14 +29,14 @@ public static class ThemeTestHelpers
for (int attempt = 0; attempt < MAX_ATTEMPTS; attempt++)
{
using IServiceScope scope = apiFactory.Services.CreateScope();
LuminaDbContext dbContext = scope.ServiceProvider.GetRequiredService<LuminaDbContext>();
NemeraDbContext dbContext = scope.ServiceProvider.GetRequiredService<NemeraDbContext>();
if (await dbContext.Themes.AnyAsync(theme => theme.ThemeId == "lumina-default" && theme.IsCurrent == true))
if (await dbContext.Themes.AnyAsync(theme => theme.ThemeId == "nemera-default" && theme.IsCurrent == true))
return;
await Task.Delay(DELAY_MILLISECONDS);
}
Assert.Fail("The bundled theme 'lumina-default' was not installed and activated within the expected time.");
Assert.Fail("The bundled theme 'nemera-default' was not installed and activated within the expected time.");
}
}
@@ -6,7 +6,7 @@ using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Api.IntegrationTests.Common.Setup;
namespace Nemera.Presentation.Api.IntegrationTests.Common.Setup;
/// <summary>
/// Observes the database transactions rolled back on each request through the <see cref="TransactionProbeInterceptor"/>.
@@ -7,7 +7,7 @@ using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Api.IntegrationTests.Common.Setup;
namespace Nemera.Presentation.Api.IntegrationTests.Common.Setup;
/// <summary>
/// Database transaction interceptor that reports the rolled back transactions to a <see cref="TransactionProbe"/>.