mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 16:11:10 +00:00
Improves the plugin system documentation, tests and conventions
- Documents the book metadata DTOs and the Book aggregate constructor parameters - References ADR-0006 in the scan snapshot repository remarks, explaining the Dapper choice - Extracts shared plugin entity fixtures and uses them in the plugin and metadata provider tests - Moves PluginLoadResult to the Common DTO models, renaming it PluginLoadResultDto - Replaces the duplicate Contracts plugin setting type with the shared kernel enum - Removes the generated plugin view Designer file and its project wiring - Drops redundant braces in the plugin repositories
This commit is contained in:
1 parent
42566dcf06
commit
3653ff5bd7
25 files changed
+168
-321
No files matched your search
+3
-19
@@ -5,7 +5,7 @@ using Lumina.Application.Common.DataAccess.Repositories.Plugins;
|
||||
using Lumina.Application.Common.DataAccess.UoW;
|
||||
using Lumina.Application.Core.Plugins.Queries.GetPlugins;
|
||||
using Lumina.Contracts.Responses.Plugins;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.Plugins;
|
||||
using Lumina.DataAccess.UnitTests.Core.Repositories.Plugins.Fixtures;
|
||||
using NSubstitute;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -39,7 +39,8 @@ public class GetPluginsQueryHandlerTests
|
||||
public async Task Handle_WhenCalled_ShouldReturnAllDetectedPlugins()
|
||||
{
|
||||
// Arrange
|
||||
List<PluginEntity> plugins = [CreatePluginEntity(), CreatePluginEntity()];
|
||||
PluginEntityFixture pluginFixture = new();
|
||||
List<PluginEntity> plugins = [pluginFixture.CreatePluginEntity(), pluginFixture.CreatePluginEntity()];
|
||||
_mockPluginRepository.GetAllAsync(Arg.Any<CancellationToken>()).Returns(plugins);
|
||||
|
||||
// Act
|
||||
@@ -65,21 +66,4 @@ public class GetPluginsQueryHandlerTests
|
||||
// Assert
|
||||
Assert.True(result.IsError);
|
||||
}
|
||||
|
||||
private static PluginEntity CreatePluginEntity()
|
||||
{
|
||||
return new PluginEntity
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Name = "Test Plugin",
|
||||
Author = "Lumina",
|
||||
Version = "1.0.0",
|
||||
Description = "A test plugin.",
|
||||
LoadStatus = PluginLoadStatus.Loaded,
|
||||
CreatedOnUtc = DateTime.UtcNow,
|
||||
CreatedBy = default,
|
||||
UpdatedOnUtc = DateTime.UtcNow,
|
||||
UpdatedBy = default
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user