mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 14:11:10 +00:00
Separates application validation errors from domain business rules
Moves the user settings, user id, scheduler display preference and thumbnail quality validation errors to the application error catalogs, leaves only business-rule errors in the domain catalogs, and records the domain-expert test for error ownership.
This commit is contained in:
1 parent
6e1253d3d5
commit
7f701ea3cc
30 files changed
+311
-273
No files matched your search
+2
-3
@@ -15,7 +15,6 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using ApplicationErrors = Lumina.Application.Common.Errors.Errors;
|
||||
using DomainErrors = Lumina.Domain.Common.Errors.Errors;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.UnitTests.Core.Scheduling.Commands.UpdateSchedulerDisplayPreferences;
|
||||
@@ -89,14 +88,14 @@ public class UpdateSchedulerDisplayPreferencesCommandHandlerTests
|
||||
// Arrange
|
||||
UpdateSchedulerDisplayPreferencesCommand command = _updateSchedulerDisplayPreferencesCommandFixture.Create(displayTimeSpan: 0);
|
||||
_mockValidator.Validate(Arg.Any<UpdateSchedulerDisplayPreferencesCommand>())
|
||||
.Returns([DomainErrors.Scheduling.SchedulerDisplayTimeSpanMustBePositive]);
|
||||
.Returns([ApplicationErrors.Scheduling.SchedulerDisplayTimeSpanMustBePositive]);
|
||||
|
||||
// Act
|
||||
Result<Updated> result = await _sut.HandleAsync(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
Assert.True(result.IsFailure);
|
||||
Assert.Equal(DomainErrors.Scheduling.SchedulerDisplayTimeSpanMustBePositive, result.FirstError);
|
||||
Assert.Equal(ApplicationErrors.Scheduling.SchedulerDisplayTimeSpanMustBePositive, result.FirstError);
|
||||
await _mockSchedulerDisplayPreferencesRepository.DidNotReceive().UpsertAsync(Arg.Any<SchedulerDisplayPreferencesEntity>(), Arg.Any<CancellationToken>());
|
||||
await _mockUnitOfWork.DidNotReceive().SaveChangesAsync(Arg.Any<CancellationToken>());
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.Scheduling.Commands.UpdateSchedulerDisplayPreferences;
|
||||
using Lumina.Application.Fixtures.Core.Scheduling.Commands.UpdateSchedulerDisplayPreferences;
|
||||
using Lumina.Application.Common.Errors;
|
||||
using Lumina.Application.UnitTests.Common.Setup;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
Reference in new issue
Block a user