mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 11:11:10 +00:00
Inlines fixtures instantiation.
This commit is contained in:
1 parent
b648e2f054
commit
59e16d645a
147 files changed
+190
-898
No files matched your search
+1
-2
@@ -32,7 +32,7 @@ public class AddRoleCommandHandlerTests
|
||||
private readonly ICurrentUserService _mockCurrentUserService;
|
||||
private readonly IRoleRepository _mockRoleRepository;
|
||||
private readonly AddRoleCommandHandler _sut;
|
||||
private readonly AddRoleCommandFixture _addRoleCommandFixture;
|
||||
private readonly AddRoleCommandFixture _addRoleCommandFixture = new();
|
||||
private readonly Guid _userId;
|
||||
|
||||
/// <summary>
|
||||
@@ -47,7 +47,6 @@ public class AddRoleCommandHandlerTests
|
||||
_mockAuthorizationService = Substitute.For<IAuthorizationService>();
|
||||
_mockCurrentUserService = Substitute.For<ICurrentUserService>();
|
||||
_mockRoleRepository = Substitute.For<IRoleRepository>();
|
||||
_addRoleCommandFixture = new AddRoleCommandFixture();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
|
||||
+2
-11
@@ -17,17 +17,8 @@ namespace Lumina.Application.UnitTests.Core.Admin.Authorization.Roles.Commands.A
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class AddRoleCommandValidatorTests
|
||||
{
|
||||
private readonly AddRoleCommandValidator _validator;
|
||||
private readonly AddRoleCommandFixture _fixture;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AddRoleCommandValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public AddRoleCommandValidatorTests()
|
||||
{
|
||||
_validator = new AddRoleCommandValidator();
|
||||
_fixture = new AddRoleCommandFixture();
|
||||
}
|
||||
private readonly AddRoleCommandValidator _validator = new();
|
||||
private readonly AddRoleCommandFixture _fixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenRoleNameIsNull_ShouldHaveValidationError()
|
||||
|
||||
+1
-2
@@ -29,7 +29,7 @@ public class DeleteRoleCommandHandlerTests
|
||||
private readonly ICurrentUserService _mockCurrentUserService;
|
||||
private readonly IRoleRepository _mockRoleRepository;
|
||||
private readonly DeleteRoleCommandHandler _sut;
|
||||
private readonly DeleteRoleCommandFixture _deleteRoleCommandFixture;
|
||||
private readonly DeleteRoleCommandFixture _deleteRoleCommandFixture = new();
|
||||
private readonly Guid _userId;
|
||||
|
||||
/// <summary>
|
||||
@@ -44,7 +44,6 @@ public class DeleteRoleCommandHandlerTests
|
||||
_mockAuthorizationService = Substitute.For<IAuthorizationService>();
|
||||
_mockCurrentUserService = Substitute.For<ICurrentUserService>();
|
||||
_mockRoleRepository = Substitute.For<IRoleRepository>();
|
||||
_deleteRoleCommandFixture = new DeleteRoleCommandFixture();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
|
||||
+1
-9
@@ -16,15 +16,7 @@ namespace Lumina.Application.UnitTests.Core.Admin.Authorization.Roles.Commands.D
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class DeleteRoleCommandValidatorTests
|
||||
{
|
||||
private readonly DeleteRoleCommandValidator _validator;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DeleteRoleCommandValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public DeleteRoleCommandValidatorTests()
|
||||
{
|
||||
_validator = new DeleteRoleCommandValidator();
|
||||
}
|
||||
private readonly DeleteRoleCommandValidator _validator = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenRoleIdIsEmpty_ShouldHaveValidationError()
|
||||
|
||||
+1
-2
@@ -32,7 +32,7 @@ public class UpdateRoleCommandHandlerTests
|
||||
private readonly ICurrentUserService _mockCurrentUserService;
|
||||
private readonly IRoleRepository _mockRoleRepository;
|
||||
private readonly UpdateRoleCommandHandler _sut;
|
||||
private readonly UpdateRoleCommandFixture _updateRoleCommandFixture;
|
||||
private readonly UpdateRoleCommandFixture _updateRoleCommandFixture = new();
|
||||
private readonly Guid _userId;
|
||||
|
||||
/// <summary>
|
||||
@@ -47,7 +47,6 @@ public class UpdateRoleCommandHandlerTests
|
||||
_mockAuthorizationService = Substitute.For<IAuthorizationService>();
|
||||
_mockCurrentUserService = Substitute.For<ICurrentUserService>();
|
||||
_mockRoleRepository = Substitute.For<IRoleRepository>();
|
||||
_updateRoleCommandFixture = new UpdateRoleCommandFixture();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
|
||||
+2
-11
@@ -17,17 +17,8 @@ namespace Lumina.Application.UnitTests.Core.Admin.Authorization.Roles.Commands.U
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class UpdateRoleCommandValidatorTests
|
||||
{
|
||||
private readonly UpdateRoleCommandValidator _validator;
|
||||
private readonly UpdateRoleCommandFixture _fixture;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UpdateRoleCommandValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public UpdateRoleCommandValidatorTests()
|
||||
{
|
||||
_validator = new UpdateRoleCommandValidator();
|
||||
_fixture = new UpdateRoleCommandFixture();
|
||||
}
|
||||
private readonly UpdateRoleCommandValidator _validator = new();
|
||||
private readonly UpdateRoleCommandFixture _fixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenRoleIdIsEmpty_ShouldHaveValidationError()
|
||||
|
||||
+1
-2
@@ -31,7 +31,7 @@ public class GetRolePermissionsQueryHandlerTests
|
||||
private readonly ICurrentUserService _mockCurrentUserService;
|
||||
private readonly IRoleRepository _mockRoleRepository;
|
||||
private readonly GetRolePermissionsQueryHandler _sut;
|
||||
private readonly GetRolePermissionsQueryFixture _getRolePermissionsQueryFixture;
|
||||
private readonly GetRolePermissionsQueryFixture _getRolePermissionsQueryFixture = new();
|
||||
private readonly Guid _userId;
|
||||
|
||||
/// <summary>
|
||||
@@ -46,7 +46,6 @@ public class GetRolePermissionsQueryHandlerTests
|
||||
_mockAuthorizationService = Substitute.For<IAuthorizationService>();
|
||||
_mockCurrentUserService = Substitute.For<ICurrentUserService>();
|
||||
_mockRoleRepository = Substitute.For<IRoleRepository>();
|
||||
_getRolePermissionsQueryFixture = new GetRolePermissionsQueryFixture();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
|
||||
+1
-9
@@ -16,15 +16,7 @@ namespace Lumina.Application.UnitTests.Core.Admin.Authorization.Roles.Queries.Ge
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetRolePermissionsQueryValidatorTests
|
||||
{
|
||||
private readonly GetRolePermissionsQueryValidator _validator;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetRolePermissionsQueryValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public GetRolePermissionsQueryValidatorTests()
|
||||
{
|
||||
_validator = new GetRolePermissionsQueryValidator();
|
||||
}
|
||||
private readonly GetRolePermissionsQueryValidator _validator = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenRoleIdIsEmpty_ShouldHaveValidationError()
|
||||
|
||||
+1
-2
@@ -30,7 +30,7 @@ public class GetRolesQueryHandlerTests
|
||||
private readonly ICurrentUserService _mockCurrentUserService;
|
||||
private readonly IRoleRepository _mockRoleRepository;
|
||||
private readonly GetRolesQueryHandler _sut;
|
||||
private readonly GetRolesQueryFixture _getRolesQueryFixture;
|
||||
private readonly GetRolesQueryFixture _getRolesQueryFixture = new();
|
||||
private readonly Guid _userId;
|
||||
|
||||
/// <summary>
|
||||
@@ -42,7 +42,6 @@ public class GetRolesQueryHandlerTests
|
||||
_mockAuthorizationService = Substitute.For<IAuthorizationService>();
|
||||
_mockCurrentUserService = Substitute.For<ICurrentUserService>();
|
||||
_mockRoleRepository = Substitute.For<IRoleRepository>();
|
||||
_getRolesQueryFixture = new GetRolesQueryFixture();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
|
||||
+2
-4
@@ -29,8 +29,8 @@ public class GetDirectoriesQueryHandlerTests
|
||||
private readonly IFixture _fixture;
|
||||
private readonly IDirectoryService _mockDirectoryService;
|
||||
private readonly GetDirectoriesQueryHandler _sut;
|
||||
private readonly DirectoryFixture _directoryFixture;
|
||||
private readonly GetDirectoriesQueryFixture _getDirectoriesQueryFixture;
|
||||
private readonly DirectoryFixture _directoryFixture = new();
|
||||
private readonly GetDirectoriesQueryFixture _getDirectoriesQueryFixture = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetDirectoriesQueryHandlerTests"/> class.
|
||||
@@ -43,8 +43,6 @@ public class GetDirectoriesQueryHandlerTests
|
||||
mockValidator.Validate(Arg.Any<GetDirectoriesQuery>())
|
||||
.Returns([]);
|
||||
_sut = new GetDirectoriesQueryHandler(_mockDirectoryService, mockValidator);
|
||||
_directoryFixture = new DirectoryFixture();
|
||||
_getDirectoriesQueryFixture = new GetDirectoriesQueryFixture();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
+2
-11
@@ -16,17 +16,8 @@ namespace Lumina.Application.UnitTests.Core.FileSystemManagement.Directories.Que
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetDirectoriesQueryValidatorTests
|
||||
{
|
||||
private readonly GetDirectoriesQueryValidator _validator;
|
||||
private readonly GetDirectoriesQueryFixture _getDirectoriesQueryFixture;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetDirectoriesQueryValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public GetDirectoriesQueryValidatorTests()
|
||||
{
|
||||
_validator = new GetDirectoriesQueryValidator();
|
||||
_getDirectoriesQueryFixture = new GetDirectoriesQueryFixture();
|
||||
}
|
||||
private readonly GetDirectoriesQueryValidator _validator = new();
|
||||
private readonly GetDirectoriesQueryFixture _getDirectoriesQueryFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
|
||||
|
||||
+1
-2
@@ -25,7 +25,7 @@ public class GetDrivesQueryHandlerTests
|
||||
{
|
||||
private readonly IDriveService _mockDriveService;
|
||||
private readonly GetDrivesQueryHandler _sut;
|
||||
private readonly GetDrivesQueryFixture _getDrivesQueryFixture;
|
||||
private readonly GetDrivesQueryFixture _getDrivesQueryFixture = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetDrivesQueryHandlerTests"/> class.
|
||||
@@ -33,7 +33,6 @@ public class GetDrivesQueryHandlerTests
|
||||
public GetDrivesQueryHandlerTests()
|
||||
{
|
||||
_mockDriveService = Substitute.For<IDriveService>();
|
||||
_getDrivesQueryFixture = new GetDrivesQueryFixture();
|
||||
_sut = new GetDrivesQueryHandler(_mockDriveService);
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -25,7 +25,7 @@ public class GetFileSystemQueryHandlerTests
|
||||
private readonly IPlatformContextManager _mockPlatformContextManager;
|
||||
private readonly IPlatformContext _mockPlatformContext;
|
||||
private readonly GetFileSystemQueryHandler _sut;
|
||||
private readonly GetFileSystemQueryFixture _getFileSystemQueryFixture;
|
||||
private readonly GetFileSystemQueryFixture _getFileSystemQueryFixture = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetFileSystemQueryHandlerTests"/> class.
|
||||
@@ -36,7 +36,6 @@ public class GetFileSystemQueryHandlerTests
|
||||
_mockPlatformContextManager = Substitute.For<IPlatformContextManager>();
|
||||
_mockPlatformContext = Substitute.For<IPlatformContext>();
|
||||
_mockPlatformContextManager.GetCurrentContext().Returns(_mockPlatformContext);
|
||||
_getFileSystemQueryFixture = new GetFileSystemQueryFixture();
|
||||
_sut = new GetFileSystemQueryHandler(_mockPlatformContextManager);
|
||||
}
|
||||
|
||||
|
||||
+2
-4
@@ -29,8 +29,8 @@ public class GetFilesQueryHandlerTests
|
||||
private readonly IFixture _fixture;
|
||||
private readonly IFileService _mockFileService;
|
||||
private readonly GetFilesQueryHandler _sut;
|
||||
private readonly FileFixture _fileFixture;
|
||||
private readonly GetFilesQueryFixture _getFilesQueryFixture;
|
||||
private readonly FileFixture _fileFixture = new();
|
||||
private readonly GetFilesQueryFixture _getFilesQueryFixture = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetFilesQueryHandlerTests"/> class.
|
||||
@@ -43,8 +43,6 @@ public class GetFilesQueryHandlerTests
|
||||
mockValidator.Validate(Arg.Any<GetFilesQuery>())
|
||||
.Returns([]);
|
||||
_sut = new GetFilesQueryHandler(_mockFileService, mockValidator);
|
||||
_fileFixture = new FileFixture();
|
||||
_getFilesQueryFixture = new GetFilesQueryFixture();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
+2
-11
@@ -16,17 +16,8 @@ namespace Lumina.Application.UnitTests.Core.FileSystemManagement.Files.Queries.G
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetFilesQueryValidatorTests
|
||||
{
|
||||
private readonly GetFilesQueryValidator _validator;
|
||||
private readonly GetFilesQueryFixture _getFilesQueryFixture;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetFilesQueryValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public GetFilesQueryValidatorTests()
|
||||
{
|
||||
_validator = new GetFilesQueryValidator();
|
||||
_getFilesQueryFixture = new GetFilesQueryFixture();
|
||||
}
|
||||
private readonly GetFilesQueryValidator _validator = new();
|
||||
private readonly GetFilesQueryFixture _getFilesQueryFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
|
||||
|
||||
+2
-4
@@ -29,8 +29,8 @@ public class GetTreeFilesQueryHandlerTests
|
||||
private readonly IFixture _fixture;
|
||||
private readonly IFileService _mockFileService;
|
||||
private readonly GetTreeFilesQueryHandler _sut;
|
||||
private readonly FileFixture _fileFixture;
|
||||
private readonly GetTreeFilesQueryFixture _getTreeFilesQueryFixture;
|
||||
private readonly FileFixture _fileFixture = new();
|
||||
private readonly GetTreeFilesQueryFixture _getTreeFilesQueryFixture = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetTreeFilesQueryHandler"/> class.
|
||||
@@ -43,8 +43,6 @@ public class GetTreeFilesQueryHandlerTests
|
||||
mockValidator.Validate(Arg.Any<GetTreeFilesQuery>())
|
||||
.Returns([]);
|
||||
_sut = new GetTreeFilesQueryHandler(_mockFileService, mockValidator);
|
||||
_fileFixture = new FileFixture();
|
||||
_getTreeFilesQueryFixture = new GetTreeFilesQueryFixture();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
+2
-11
@@ -16,17 +16,8 @@ namespace Lumina.Application.UnitTests.Core.FileSystemManagement.Files.Queries.G
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetTreeFilesQueryValidatorTests
|
||||
{
|
||||
private readonly GetTreeFilesQueryValidator _validator;
|
||||
private readonly GetTreeFilesQueryFixture _getTreeFilesQueryFixture;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetTreeFilesQueryValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public GetTreeFilesQueryValidatorTests()
|
||||
{
|
||||
_validator = new GetTreeFilesQueryValidator();
|
||||
_getTreeFilesQueryFixture = new GetTreeFilesQueryFixture();
|
||||
}
|
||||
private readonly GetTreeFilesQueryValidator _validator = new();
|
||||
private readonly GetTreeFilesQueryFixture _getTreeFilesQueryFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
|
||||
|
||||
+1
-2
@@ -24,7 +24,7 @@ public class CombinePathCommandHandlerTests
|
||||
private readonly IFixture _fixture;
|
||||
private readonly IPathService _mockPathService;
|
||||
private readonly CombinePathCommandHandler _sut;
|
||||
private readonly CombinePathCommandFixture _combinePathCommandFixture;
|
||||
private readonly CombinePathCommandFixture _combinePathCommandFixture = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CombinePathCommandHandlerTests"/> class.
|
||||
@@ -37,7 +37,6 @@ public class CombinePathCommandHandlerTests
|
||||
mockValidator.Validate(Arg.Any<CombinePathCommand>())
|
||||
.Returns([]);
|
||||
_sut = new CombinePathCommandHandler(_mockPathService, mockValidator);
|
||||
_combinePathCommandFixture = new CombinePathCommandFixture();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
+2
-11
@@ -16,17 +16,8 @@ namespace Lumina.Application.UnitTests.Core.FileSystemManagement.Paths.Commands.
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class CombinePathCommandValidatorTests
|
||||
{
|
||||
private readonly CombinePathCommandValidator _validator;
|
||||
private readonly CombinePathCommandFixture _combinePathCommandFixture;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CombinePathCommandValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public CombinePathCommandValidatorTests()
|
||||
{
|
||||
_validator = new CombinePathCommandValidator();
|
||||
_combinePathCommandFixture = new CombinePathCommandFixture();
|
||||
}
|
||||
private readonly CombinePathCommandValidator _validator = new();
|
||||
private readonly CombinePathCommandFixture _combinePathCommandFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenOriginalPathIsNull_ShouldHaveValidationError()
|
||||
|
||||
+2
-4
@@ -29,8 +29,8 @@ public class SplitPathCommandHandlerTests
|
||||
private readonly IFixture _fixture;
|
||||
private readonly IPathService _mockPathService;
|
||||
private readonly SplitPathCommandHandler _sut;
|
||||
private readonly PathSegmentFixture _pathSegmentFixture;
|
||||
private readonly SplitPathCommandFixture _splitPathCommandFixture;
|
||||
private readonly PathSegmentFixture _pathSegmentFixture = new();
|
||||
private readonly SplitPathCommandFixture _splitPathCommandFixture = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SplitPathCommandHandlerTests"/> class.
|
||||
@@ -43,8 +43,6 @@ public class SplitPathCommandHandlerTests
|
||||
mockValidator.Validate(Arg.Any<SplitPathCommand>())
|
||||
.Returns([]);
|
||||
_sut = new SplitPathCommandHandler(_mockPathService, mockValidator);
|
||||
_pathSegmentFixture = new PathSegmentFixture();
|
||||
_splitPathCommandFixture = new SplitPathCommandFixture();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
+2
-11
@@ -16,17 +16,8 @@ namespace Lumina.Application.UnitTests.Core.FileSystemManagement.Paths.Commands.
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class SplitPathCommandValidatorTests
|
||||
{
|
||||
private readonly SplitPathCommandValidator _validator;
|
||||
private readonly SplitPathCommandFixture _splitPathCommandFixture;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SplitPathCommandValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public SplitPathCommandValidatorTests()
|
||||
{
|
||||
_validator = new SplitPathCommandValidator();
|
||||
_splitPathCommandFixture = new SplitPathCommandFixture();
|
||||
}
|
||||
private readonly SplitPathCommandValidator _validator = new();
|
||||
private readonly SplitPathCommandFixture _splitPathCommandFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
|
||||
|
||||
+1
-2
@@ -21,7 +21,7 @@ public class CheckPathExistsQueryHandlerTests
|
||||
{
|
||||
private readonly IPathService _mockPathService;
|
||||
private readonly CheckPathExistsQueryHandler _sut;
|
||||
private readonly CheckPathExistsQueryFixture _checkPathExistsQueryFixture;
|
||||
private readonly CheckPathExistsQueryFixture _checkPathExistsQueryFixture = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CheckPathExistsQueryHandlerTests"/> class.
|
||||
@@ -29,7 +29,6 @@ public class CheckPathExistsQueryHandlerTests
|
||||
public CheckPathExistsQueryHandlerTests()
|
||||
{
|
||||
_mockPathService = Substitute.For<IPathService>();
|
||||
_checkPathExistsQueryFixture = new CheckPathExistsQueryFixture();
|
||||
IValidator<CheckPathExistsQuery> mockValidator = Substitute.For<IValidator<CheckPathExistsQuery>>();
|
||||
mockValidator.Validate(Arg.Any<CheckPathExistsQuery>())
|
||||
.Returns([]);
|
||||
|
||||
+2
-11
@@ -16,17 +16,8 @@ namespace Lumina.Application.UnitTests.Core.FileSystemManagement.Paths.Queries.C
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class CheckPathExistsQueryValidatorTests
|
||||
{
|
||||
private readonly CheckPathExistsQueryValidator _validator;
|
||||
private readonly CheckPathExistsQueryFixture _checkPathExistsQueryFixture;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CheckPathExistsQueryValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public CheckPathExistsQueryValidatorTests()
|
||||
{
|
||||
_validator = new CheckPathExistsQueryValidator();
|
||||
_checkPathExistsQueryFixture = new CheckPathExistsQueryFixture();
|
||||
}
|
||||
private readonly CheckPathExistsQueryValidator _validator = new();
|
||||
private readonly CheckPathExistsQueryFixture _checkPathExistsQueryFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
|
||||
|
||||
+2
-4
@@ -28,8 +28,8 @@ public class GetPathParentQueryHandlerTests
|
||||
private readonly IFixture _fixture;
|
||||
private readonly IPathService _mockPathService;
|
||||
private readonly GetPathParentQueryHandler _sut;
|
||||
private readonly PathSegmentFixture _pathSegmentFixture;
|
||||
private readonly GetPathParentQueryFixture _getPathParentQueryFixture;
|
||||
private readonly PathSegmentFixture _pathSegmentFixture = new();
|
||||
private readonly GetPathParentQueryFixture _getPathParentQueryFixture = new();
|
||||
|
||||
public GetPathParentQueryHandlerTests()
|
||||
{
|
||||
@@ -39,8 +39,6 @@ public class GetPathParentQueryHandlerTests
|
||||
mockValidator.Validate(Arg.Any<GetPathParentQuery>())
|
||||
.Returns([]);
|
||||
_sut = new GetPathParentQueryHandler(_mockPathService, mockValidator);
|
||||
_pathSegmentFixture = new PathSegmentFixture();
|
||||
_getPathParentQueryFixture = new GetPathParentQueryFixture();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
+2
-11
@@ -16,17 +16,8 @@ namespace Lumina.Application.UnitTests.Core.FileSystemManagement.Paths.Queries.G
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetPathParentQueryValidatorTests
|
||||
{
|
||||
private readonly GetPathParentQueryValidator _validator;
|
||||
private readonly GetPathParentQueryFixture _getPathParentQueryFixture;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetPathParentQueryValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public GetPathParentQueryValidatorTests()
|
||||
{
|
||||
_validator = new GetPathParentQueryValidator();
|
||||
_getPathParentQueryFixture = new GetPathParentQueryFixture();
|
||||
}
|
||||
private readonly GetPathParentQueryValidator _validator = new();
|
||||
private readonly GetPathParentQueryFixture _getPathParentQueryFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
|
||||
|
||||
+2
-4
@@ -23,8 +23,8 @@ public class GetPathRootQueryHandlerTests
|
||||
{
|
||||
private readonly IPathService _mockPathService;
|
||||
private readonly GetPathRootQueryHandler _sut;
|
||||
private readonly PathSegmentFixture _pathSegmentFixture;
|
||||
private readonly GetPathRootQueryFixture _getPathRootQueryFixture;
|
||||
private readonly PathSegmentFixture _pathSegmentFixture = new();
|
||||
private readonly GetPathRootQueryFixture _getPathRootQueryFixture = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetPathRootQueryHandlerTests"/> class.
|
||||
@@ -32,12 +32,10 @@ public class GetPathRootQueryHandlerTests
|
||||
public GetPathRootQueryHandlerTests()
|
||||
{
|
||||
_mockPathService = Substitute.For<IPathService>();
|
||||
_getPathRootQueryFixture = new GetPathRootQueryFixture();
|
||||
IValidator<GetPathRootQuery> mockValidator = Substitute.For<IValidator<GetPathRootQuery>>();
|
||||
mockValidator.Validate(Arg.Any<GetPathRootQuery>())
|
||||
.Returns([]);
|
||||
_sut = new GetPathRootQueryHandler(_mockPathService, mockValidator);
|
||||
_pathSegmentFixture = new PathSegmentFixture();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
+2
-11
@@ -16,17 +16,8 @@ namespace Lumina.Application.UnitTests.Core.FileSystemManagement.Paths.Queries.G
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetPathRootQueryValidatorTests
|
||||
{
|
||||
private readonly GetPathRootQueryValidator _validator;
|
||||
private readonly GetPathRootQueryFixture _getPathRootQueryFixture;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetPathRootQueryValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public GetPathRootQueryValidatorTests()
|
||||
{
|
||||
_validator = new GetPathRootQueryValidator();
|
||||
_getPathRootQueryFixture = new GetPathRootQueryFixture();
|
||||
}
|
||||
private readonly GetPathRootQueryValidator _validator = new();
|
||||
private readonly GetPathRootQueryFixture _getPathRootQueryFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
|
||||
|
||||
+1
-2
@@ -23,7 +23,7 @@ public class ValidatePathQueryHandlerTests
|
||||
private readonly IPathService _mockPathService;
|
||||
private readonly IValidator<ValidatePathQuery> _mockValidator;
|
||||
private readonly ValidatePathQueryHandler _sut;
|
||||
private readonly ValidatePathQueryFixture _validatePathQueryFixture;
|
||||
private readonly ValidatePathQueryFixture _validatePathQueryFixture = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ValidatePathQueryHandlerTests"/> class.
|
||||
@@ -32,7 +32,6 @@ public class ValidatePathQueryHandlerTests
|
||||
{
|
||||
_mockPathService = Substitute.For<IPathService>();
|
||||
_mockValidator = Substitute.For<IValidator<ValidatePathQuery>>();
|
||||
_validatePathQueryFixture = new ValidatePathQueryFixture();
|
||||
_mockValidator.Validate(Arg.Any<ValidatePathQuery>())
|
||||
.Returns([]);
|
||||
_sut = new ValidatePathQueryHandler(_mockPathService, _mockValidator);
|
||||
|
||||
+2
-11
@@ -16,17 +16,8 @@ namespace Lumina.Application.UnitTests.Core.FileSystemManagement.Paths.Queries.V
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ValidatePathQueryValidatorTests
|
||||
{
|
||||
private readonly ValidatePathQueryValidator _validator;
|
||||
private readonly ValidatePathQueryFixture _validatePathQueryFixture;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ValidatePathQueryValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public ValidatePathQueryValidatorTests()
|
||||
{
|
||||
_validator = new ValidatePathQueryValidator();
|
||||
_validatePathQueryFixture = new ValidatePathQueryFixture();
|
||||
}
|
||||
private readonly ValidatePathQueryValidator _validator = new();
|
||||
private readonly ValidatePathQueryFixture _validatePathQueryFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
|
||||
|
||||
+2
-4
@@ -26,15 +26,13 @@ public class GetThumbnailQueryHandlerTests
|
||||
private readonly IFixture _fixture;
|
||||
private readonly IThumbnailService _mockThumbnailService;
|
||||
private readonly GetThumbnailQueryHandler _sut;
|
||||
private readonly GetThumbnailQueryFixture _getThumbnailQueryFixture;
|
||||
private readonly ThumbnailFixture _thumbnailFixture;
|
||||
private readonly GetThumbnailQueryFixture _getThumbnailQueryFixture = new();
|
||||
private readonly ThumbnailFixture _thumbnailFixture = new();
|
||||
|
||||
public GetThumbnailQueryHandlerTests()
|
||||
{
|
||||
_fixture = new Fixture().Customize(new AutoNSubstituteCustomization());
|
||||
_mockThumbnailService = Substitute.For<IThumbnailService>();
|
||||
_getThumbnailQueryFixture = new GetThumbnailQueryFixture();
|
||||
_thumbnailFixture = new ThumbnailFixture();
|
||||
IValidator<GetThumbnailQuery> mockValidator = Substitute.For<IValidator<GetThumbnailQuery>>();
|
||||
mockValidator.Validate(Arg.Any<GetThumbnailQuery>())
|
||||
.Returns([]);
|
||||
|
||||
+1
-9
@@ -15,15 +15,7 @@ namespace Lumina.Application.UnitTests.Core.FileSystemManagement.Thumbnails.Quer
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetThumbnailQueryValidatorTests
|
||||
{
|
||||
private readonly GetThumbnailQueryValidator _validator;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetThumbnailQueryValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public GetThumbnailQueryValidatorTests()
|
||||
{
|
||||
_validator = new GetThumbnailQueryValidator();
|
||||
}
|
||||
private readonly GetThumbnailQueryValidator _validator = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
|
||||
|
||||
+1
-2
@@ -39,7 +39,7 @@ public class SetupApplicationCommandHandlerTests
|
||||
private readonly IDataSeedService _mockDataSeedService;
|
||||
private readonly SetupApplicationCommandHandler _sut;
|
||||
private readonly UserEntityFixture _userEntityFixture = new();
|
||||
private readonly SetupApplicationCommandFixture _setupApplicationCommandFixture;
|
||||
private readonly SetupApplicationCommandFixture _setupApplicationCommandFixture = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetupApplicationCommandHandlerTests"/> class.
|
||||
@@ -54,7 +54,6 @@ public class SetupApplicationCommandHandlerTests
|
||||
_mockUserRepository = Substitute.For<IUserRepository>();
|
||||
_mockDateTimeProvider = Substitute.For<IDateTimeProvider>();
|
||||
_mockDataSeedService = Substitute.For<IDataSeedService>();
|
||||
_setupApplicationCommandFixture = new SetupApplicationCommandFixture();
|
||||
IValidator<SetupApplicationCommand> mockValidator = Substitute.For<IValidator<SetupApplicationCommand>>();
|
||||
mockValidator.Validate(Arg.Any<SetupApplicationCommand>())
|
||||
.Returns([]);
|
||||
|
||||
+2
-11
@@ -16,17 +16,8 @@ namespace Lumina.Application.UnitTests.Core.Maintenance.ApplicationSetup.Command
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class SetupApplicationCommandValidatorTests
|
||||
{
|
||||
private readonly SetupApplicationCommandValidator _validator;
|
||||
private readonly SetupApplicationCommandFixture _commandFixture;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetupApplicationCommandValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public SetupApplicationCommandValidatorTests()
|
||||
{
|
||||
_validator = new SetupApplicationCommandValidator();
|
||||
_commandFixture = new SetupApplicationCommandFixture();
|
||||
}
|
||||
private readonly SetupApplicationCommandValidator _validator = new();
|
||||
private readonly SetupApplicationCommandFixture _commandFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenUsernameIsNull_ShouldHaveValidationError()
|
||||
|
||||
+1
-2
@@ -33,7 +33,7 @@ public class AddBookCommandHandlerTests
|
||||
private readonly IUnitOfWork _mockUnitOfWork;
|
||||
private readonly IBookRepository _mockBookRepository;
|
||||
private readonly AddBookCommandHandler _sut;
|
||||
private readonly AddBookCommandFixture _commandBookFixture;
|
||||
private readonly AddBookCommandFixture _commandBookFixture = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AddBookCommandHandlerTests"/> class.
|
||||
@@ -53,7 +53,6 @@ public class AddBookCommandHandlerTests
|
||||
mockValidator.Validate(Arg.Any<AddBookCommand>())
|
||||
.Returns([]);
|
||||
_sut = new AddBookCommandHandler(_mockUnitOfWork, mockValidator);
|
||||
_commandBookFixture = new AddBookCommandFixture();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
+2
-11
@@ -20,17 +20,8 @@ namespace Lumina.Application.UnitTests.Core.MediaLibrary.WrittenContentLibrary.B
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class AddBookCommandValidatorTests
|
||||
{
|
||||
private readonly AddBookCommandFixture _commandBookFixture;
|
||||
private readonly AddBookCommandValidator _validator;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AddBookCommandValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public AddBookCommandValidatorTests()
|
||||
{
|
||||
_validator = new AddBookCommandValidator();
|
||||
_commandBookFixture = new AddBookCommandFixture();
|
||||
}
|
||||
private readonly AddBookCommandFixture _commandBookFixture = new();
|
||||
private readonly AddBookCommandValidator _validator = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenTitleIsNull_ShouldHaveValidationError()
|
||||
|
||||
+2
-11
@@ -16,17 +16,8 @@ namespace Lumina.Application.UnitTests.Core.UsersManagement.Authentication.Comma
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ChangePasswordCommandValidatorTests
|
||||
{
|
||||
private readonly ChangePasswordCommandValidator _validator;
|
||||
private readonly ChangePasswordCommandFixture _changePasswordCommandFixture;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ChangePasswordCommandValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public ChangePasswordCommandValidatorTests()
|
||||
{
|
||||
_validator = new ChangePasswordCommandValidator();
|
||||
_changePasswordCommandFixture = new ChangePasswordCommandFixture();
|
||||
}
|
||||
private readonly ChangePasswordCommandValidator _validator = new();
|
||||
private readonly ChangePasswordCommandFixture _changePasswordCommandFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenUsernameIsNull_ShouldHaveValidationError()
|
||||
|
||||
+2
-11
@@ -16,17 +16,8 @@ namespace Lumina.Application.UnitTests.Core.UsersManagement.Authentication.Comma
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class RecoverPasswordCommandValidatorTests
|
||||
{
|
||||
private readonly RecoverPasswordCommandValidator _validator;
|
||||
private readonly RecoverPasswordCommandFixture _recoverPasswordCommandFixture;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RecoverPasswordCommandValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public RecoverPasswordCommandValidatorTests()
|
||||
{
|
||||
_validator = new RecoverPasswordCommandValidator();
|
||||
_recoverPasswordCommandFixture = new RecoverPasswordCommandFixture();
|
||||
}
|
||||
private readonly RecoverPasswordCommandValidator _validator = new();
|
||||
private readonly RecoverPasswordCommandFixture _recoverPasswordCommandFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenUsernameIsNull_ShouldHaveValidationError()
|
||||
|
||||
+2
-11
@@ -16,17 +16,8 @@ namespace Lumina.Application.UnitTests.Core.UsersManagement.Authentication.Comma
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class RegisterUserCommandValidatorTests
|
||||
{
|
||||
private readonly RegisterUserCommandValidator _validator;
|
||||
private readonly RegisterUserCommandFixture _registerUserCommandFixture;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RegisterUserCommandValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public RegisterUserCommandValidatorTests()
|
||||
{
|
||||
_validator = new RegisterUserCommandValidator();
|
||||
_registerUserCommandFixture = new RegisterUserCommandFixture();
|
||||
}
|
||||
private readonly RegisterUserCommandValidator _validator = new();
|
||||
private readonly RegisterUserCommandFixture _registerUserCommandFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenUsernameIsNull_ShouldHaveValidationError()
|
||||
|
||||
+1
-2
@@ -33,7 +33,7 @@ public class GetUsersQueryHandlerTests
|
||||
private readonly IUserRepository _mockUserRepository;
|
||||
private readonly GetUsersQueryHandler _sut;
|
||||
private readonly UserEntityFixture _userEntityFixture = new();
|
||||
private readonly GetUsersQueryFixture _getUsersQueryFixture;
|
||||
private readonly GetUsersQueryFixture _getUsersQueryFixture = new();
|
||||
private readonly Guid _userId;
|
||||
|
||||
/// <summary>
|
||||
@@ -45,7 +45,6 @@ public class GetUsersQueryHandlerTests
|
||||
_mockAuthorizationService = Substitute.For<IAuthorizationService>();
|
||||
_mockCurrentUserService = Substitute.For<ICurrentUserService>();
|
||||
_mockUserRepository = Substitute.For<IUserRepository>();
|
||||
_getUsersQueryFixture = new GetUsersQueryFixture();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
|
||||
+2
-11
@@ -16,17 +16,8 @@ namespace Lumina.Application.UnitTests.Core.UsersManagement.Authentication.Queri
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class LoginUserQueryValidatorTests
|
||||
{
|
||||
private readonly LoginUserQueryValidator _validator;
|
||||
private readonly LoginUserQueryFixture _loginUserQueryFixture;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LoginUserQueryValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public LoginUserQueryValidatorTests()
|
||||
{
|
||||
_validator = new LoginUserQueryValidator();
|
||||
_loginUserQueryFixture = new LoginUserQueryFixture();
|
||||
}
|
||||
private readonly LoginUserQueryValidator _validator = new();
|
||||
private readonly LoginUserQueryFixture _loginUserQueryFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenUsernameIsNull_ShouldHaveValidationError()
|
||||
|
||||
+1
-2
@@ -40,7 +40,7 @@ public class UpdateUserRoleAndPermissionsCommandHandlerTests
|
||||
private readonly IPermissionRepository _mockPermissionRepository;
|
||||
private readonly UpdateUserRoleAndPermissionsCommandHandler _sut;
|
||||
private readonly UserEntityFixture _userEntityFixture = new();
|
||||
private readonly UpdateUserRoleAndPermissionsCommandFixture _updateUserRoleAndPermissionsCommandFixture;
|
||||
private readonly UpdateUserRoleAndPermissionsCommandFixture _updateUserRoleAndPermissionsCommandFixture = new();
|
||||
private readonly Guid _userId;
|
||||
|
||||
/// <summary>
|
||||
@@ -54,7 +54,6 @@ public class UpdateUserRoleAndPermissionsCommandHandlerTests
|
||||
_mockUserRepository = Substitute.For<IUserRepository>();
|
||||
_mockRoleRepository = Substitute.For<IRoleRepository>();
|
||||
_mockPermissionRepository = Substitute.For<IPermissionRepository>();
|
||||
_updateUserRoleAndPermissionsCommandFixture = new UpdateUserRoleAndPermissionsCommandFixture();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
|
||||
+1
-9
@@ -17,15 +17,7 @@ namespace Lumina.Application.UnitTests.Core.UsersManagement.Authorization.Comman
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class UpdateUserRoleAndPermissionsCommandValidatorTests
|
||||
{
|
||||
private readonly UpdateUserRoleAndPermissionsCommandValidator _validator;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UpdateUserRoleAndPermissionsCommandValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public UpdateUserRoleAndPermissionsCommandValidatorTests()
|
||||
{
|
||||
_validator = new UpdateUserRoleAndPermissionsCommandValidator();
|
||||
}
|
||||
private readonly UpdateUserRoleAndPermissionsCommandValidator _validator = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenUserIdIsEmpty_ShouldHaveValidationError()
|
||||
|
||||
+2
-4
@@ -27,8 +27,8 @@ public class GetAuthorizationQueryHandlerTests
|
||||
private readonly IAuthorizationService _mockAuthorizationService;
|
||||
private readonly ICurrentUserService _mockCurrentUserService;
|
||||
private readonly GetAuthorizationQueryHandler _sut;
|
||||
private readonly GetAuthorizationQueryFixture _getAuthorizationQueryFixture;
|
||||
private readonly UserAuthorizationEntityFixture _userAuthorizationEntityFixture;
|
||||
private readonly GetAuthorizationQueryFixture _getAuthorizationQueryFixture = new();
|
||||
private readonly UserAuthorizationEntityFixture _userAuthorizationEntityFixture = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetAuthorizationQueryHandlerTests"/> class.
|
||||
@@ -37,8 +37,6 @@ public class GetAuthorizationQueryHandlerTests
|
||||
{
|
||||
_mockAuthorizationService = Substitute.For<IAuthorizationService>();
|
||||
_mockCurrentUserService = Substitute.For<ICurrentUserService>();
|
||||
_getAuthorizationQueryFixture = new GetAuthorizationQueryFixture();
|
||||
_userAuthorizationEntityFixture = new UserAuthorizationEntityFixture();
|
||||
IValidator<GetAuthorizationQuery> mockValidator = Substitute.For<IValidator<GetAuthorizationQuery>>();
|
||||
mockValidator.Validate(Arg.Any<GetAuthorizationQuery>())
|
||||
.Returns([]);
|
||||
|
||||
+2
-11
@@ -17,17 +17,8 @@ namespace Lumina.Application.UnitTests.Core.UsersManagement.Authorization.Querie
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetAuthorizationQueryValidatorTests
|
||||
{
|
||||
private readonly GetAuthorizationQueryValidator _validator;
|
||||
private readonly GetAuthorizationQueryFixture _getAuthorizationQueryFixture;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetAuthorizationQueryValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public GetAuthorizationQueryValidatorTests()
|
||||
{
|
||||
_validator = new GetAuthorizationQueryValidator();
|
||||
_getAuthorizationQueryFixture = new GetAuthorizationQueryFixture();
|
||||
}
|
||||
private readonly GetAuthorizationQueryValidator _validator = new();
|
||||
private readonly GetAuthorizationQueryFixture _getAuthorizationQueryFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenUserIdIsNull_ShouldHaveValidationError()
|
||||
|
||||
+1
-2
@@ -33,7 +33,7 @@ public class GetUserPermissionsQueryHandlerTests
|
||||
private readonly ICurrentUserService _mockCurrentUserService;
|
||||
private readonly IUserRepository _mockUserRepository;
|
||||
private readonly GetUserPermissionsQueryHandler _sut;
|
||||
private readonly GetUserPermissionsQueryFixture _getUserPermissionsQueryFixture;
|
||||
private readonly GetUserPermissionsQueryFixture _getUserPermissionsQueryFixture = new();
|
||||
private readonly Guid _userId;
|
||||
|
||||
/// <summary>
|
||||
@@ -45,7 +45,6 @@ public class GetUserPermissionsQueryHandlerTests
|
||||
_mockAuthorizationService = Substitute.For<IAuthorizationService>();
|
||||
_mockCurrentUserService = Substitute.For<ICurrentUserService>();
|
||||
_mockUserRepository = Substitute.For<IUserRepository>();
|
||||
_getUserPermissionsQueryFixture = new GetUserPermissionsQueryFixture();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
|
||||
+1
-9
@@ -16,15 +16,7 @@ namespace Lumina.Application.UnitTests.Core.UsersManagement.Authorization.Querie
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetUserPermissionsQueryValidatorTests
|
||||
{
|
||||
private readonly GetUserPermissionsQueryValidator _validator;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetUserPermissionsQueryValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public GetUserPermissionsQueryValidatorTests()
|
||||
{
|
||||
_validator = new GetUserPermissionsQueryValidator();
|
||||
}
|
||||
private readonly GetUserPermissionsQueryValidator _validator = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenUserIdIsNull_ShouldHaveValidationError()
|
||||
|
||||
+1
-2
@@ -32,7 +32,7 @@ public class GetUserRoleQueryHandlerTests
|
||||
private readonly IUserRepository _mockUserRepository;
|
||||
private readonly GetUserRoleQueryHandler _sut;
|
||||
private readonly UserEntityFixture _userEntityFixture = new();
|
||||
private readonly GetUserRoleQueryFixture _getUserRoleQueryFixture;
|
||||
private readonly GetUserRoleQueryFixture _getUserRoleQueryFixture = new();
|
||||
private readonly Guid _userId;
|
||||
|
||||
/// <summary>
|
||||
@@ -44,7 +44,6 @@ public class GetUserRoleQueryHandlerTests
|
||||
_mockAuthorizationService = Substitute.For<IAuthorizationService>();
|
||||
_mockCurrentUserService = Substitute.For<ICurrentUserService>();
|
||||
_mockUserRepository = Substitute.For<IUserRepository>();
|
||||
_getUserRoleQueryFixture = new GetUserRoleQueryFixture();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
|
||||
+1
-9
@@ -16,15 +16,7 @@ namespace Lumina.Application.UnitTests.Core.UsersManagement.Authorization.Querie
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetUserRoleQueryValidatorTests
|
||||
{
|
||||
private readonly GetUserRoleQueryValidator _validator;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetUserRoleQueryValidatorTests"/> class.
|
||||
/// </summary>
|
||||
public GetUserRoleQueryValidatorTests()
|
||||
{
|
||||
_validator = new GetUserRoleQueryValidator();
|
||||
}
|
||||
private readonly GetUserRoleQueryValidator _validator = new();
|
||||
|
||||
[Fact]
|
||||
public void Validate_WhenUserIdIsNull_ShouldHaveValidationError()
|
||||
|
||||
Reference in new issue
Block a user