mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 12: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
+8
-7
@@ -2,10 +2,11 @@
|
||||
using Lumina.Application.Core.FileSystemManagement.Thumbnails.Queries.GetThumbnail;
|
||||
using Lumina.Application.Fixtures.Core.FileSystemManagement.Thumbnails.Queries.GetThumbnail;
|
||||
using Lumina.Application.UnitTests.Common.Setup;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using ApplicationErrors = Lumina.Application.Common.Errors.Errors;
|
||||
using DomainErrors = Lumina.Domain.Common.Errors.Errors;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.UnitTests.Core.FileSystemManagement.Thumbnails.Queries.GetThumbnail;
|
||||
@@ -29,7 +30,7 @@ public class GetThumbnailQueryValidatorTests
|
||||
List<Error> result = _validator.TestValidate(query);
|
||||
|
||||
// Assert
|
||||
result.ShouldHaveValidationError(Errors.FileSystemManagement.PathCannotBeEmpty);
|
||||
result.ShouldHaveValidationError(DomainErrors.FileSystemManagement.PathCannotBeEmpty);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -42,7 +43,7 @@ public class GetThumbnailQueryValidatorTests
|
||||
List<Error> result = _validator.TestValidate(query);
|
||||
|
||||
// Assert
|
||||
result.ShouldHaveValidationError(Errors.FileSystemManagement.PathCannotBeEmpty);
|
||||
result.ShouldHaveValidationError(DomainErrors.FileSystemManagement.PathCannotBeEmpty);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -55,7 +56,7 @@ public class GetThumbnailQueryValidatorTests
|
||||
List<Error> result = _validator.TestValidate(query);
|
||||
|
||||
// Assert
|
||||
result.ShouldNotHaveValidationError(Errors.FileSystemManagement.PathCannotBeEmpty);
|
||||
result.ShouldNotHaveValidationError(DomainErrors.FileSystemManagement.PathCannotBeEmpty);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -68,7 +69,7 @@ public class GetThumbnailQueryValidatorTests
|
||||
List<Error> result = _validator.TestValidate(query);
|
||||
|
||||
// Assert
|
||||
result.ShouldHaveValidationError(Errors.Thumbnails.ImageQualityMustBeBetweenZeroAndOneHundred);
|
||||
result.ShouldHaveValidationError(ApplicationErrors.Thumbnails.ImageQualityMustBeBetweenZeroAndOneHundred);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -81,7 +82,7 @@ public class GetThumbnailQueryValidatorTests
|
||||
List<Error> result = _validator.TestValidate(query);
|
||||
|
||||
// Assert
|
||||
result.ShouldHaveValidationError(Errors.Thumbnails.ImageQualityMustBeBetweenZeroAndOneHundred);
|
||||
result.ShouldHaveValidationError(ApplicationErrors.Thumbnails.ImageQualityMustBeBetweenZeroAndOneHundred);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -94,7 +95,7 @@ public class GetThumbnailQueryValidatorTests
|
||||
List<Error> result = _validator.TestValidate(query);
|
||||
|
||||
// Assert
|
||||
result.ShouldNotHaveValidationError(Errors.Thumbnails.ImageQualityMustBeBetweenZeroAndOneHundred);
|
||||
result.ShouldNotHaveValidationError(ApplicationErrors.Thumbnails.ImageQualityMustBeBetweenZeroAndOneHundred);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user