eliminates region sections

This commit is contained in:
BinaryAlley committed 2024-10-12 22:03:57 +03:00
1 parent 705c02b90d
commit 405fc1ff9a
370 files changed
+47 -1618

No files matched your search

@@ -19,11 +19,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Directories.Fixtures;
[ExcludeFromCodeCoverage]
public class DirectoryFixture
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly Faker _faker;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="DirectoryFixture"/> class.
/// </summary>
@@ -31,9 +28,7 @@ public class DirectoryFixture
{
_faker = new Faker();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid <see cref="Directory"/>.
/// </summary>
@@ -112,5 +107,4 @@ public class DirectoryFixture
}
return CreateDirectory(childItems: childItems);
}
#endregion
}
@@ -14,12 +14,9 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Directories.Fixtures;
[ExcludeFromCodeCoverage]
public class DirectoryResponseFixture
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly Faker _faker = new();
private readonly FileSystemItemModelFixture _fileSystemItemModelFixture = new();
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid <see cref="DirectoryResponse"/>.
/// </summary>
@@ -46,5 +43,4 @@ public class DirectoryResponseFixture
{
return Enumerable.Range(0, count).Select(_ => Create(itemCount)).ToList();
}
#endregion
}
@@ -14,11 +14,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Directories.Fixtures;
[ExcludeFromCodeCoverage]
public class FileSystemItemModelFixture
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly Faker _faker = new();
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid <see cref="FileSystemItemModel"/>.
/// </summary>
@@ -42,5 +39,4 @@ public class FileSystemItemModelFixture
{
return Enumerable.Range(0, count).Select(_ => Create()).ToList();
}
#endregion
}
@@ -15,11 +15,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Directories.Fixtures;
[ExcludeFromCodeCoverage]
public class FileSystemTreeNodeResponseFixture
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly Faker _faker = new();
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a single <see cref="FileSystemTreeNodeResponse"/> with a nested structure.
/// </summary>
@@ -58,5 +55,4 @@ public class FileSystemTreeNodeResponseFixture
{
return Enumerable.Range(0, count).Select(_ => Create(0, maxDepth, maxChildren)).ToList();
}
#endregion
}
@@ -12,7 +12,6 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Directories.Queries.G
[ExcludeFromCodeCoverage]
public class GetDirectoriesQueryFixture
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid query to get directories.
/// </summary>
@@ -28,5 +27,4 @@ public class GetDirectoriesQueryFixture
.RuleFor(x => x.Path, f => f.System.DirectoryPath())
.RuleFor(x => x.IncludeHiddenElements, f => includeHiddenElements);
}
#endregion
}
@@ -27,16 +27,13 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Directories.Queries.G
[ExcludeFromCodeCoverage]
public class GetDirectoriesQueryHandlerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IFixture _fixture;
private readonly IMapper _mockMapper;
private readonly IDirectoryService _mockDirectoryService;
private readonly GetDirectoriesQueryHandler _sut;
private readonly DirectoryFixture _directoryFixture;
private readonly DirectoryResponseFixture _directoryResponseFixture;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetDirectoriesQueryHandlerTests"/> class.
/// </summary>
@@ -49,9 +46,7 @@ public class GetDirectoriesQueryHandlerTests
_directoryFixture = new DirectoryFixture();
_directoryResponseFixture = new DirectoryResponseFixture();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task Handle_WhenCalledWithValidQueryWithoutFilesIncluded_ShouldReturnSuccessResult()
{
@@ -139,5 +134,4 @@ public class GetDirectoriesQueryHandlerTests
result.Value.Should().BeEmpty();
_mockDirectoryService.Received(1).GetSubdirectories(query.Path, query.IncludeHiddenElements);
}
#endregion
}
@@ -14,11 +14,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Directories.Queries.G
[ExcludeFromCodeCoverage]
public class GetDirectoriesQueryValidatorTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly GetDirectoriesQueryValidator _validator;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetDirectoriesQueryValidatorTests"/> class.
/// </summary>
@@ -26,9 +23,7 @@ public class GetDirectoriesQueryValidatorTests
{
_validator = new GetDirectoriesQueryValidator();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
{
@@ -115,5 +110,4 @@ public class GetDirectoriesQueryValidatorTests
// Assert
result.ShouldNotHaveValidationErrorFor(x => x.IncludeHiddenElements);
}
#endregion
}
@@ -12,7 +12,6 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Directories.Queries.G
[ExcludeFromCodeCoverage]
public class GetDirectoryTreeQueryFixture
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid query to get directory tree.
/// </summary>
@@ -31,5 +30,4 @@ public class GetDirectoryTreeQueryFixture
.RuleFor(x => x.IncludeFiles, f => includeFiles)
.RuleFor(x => x.IncludeHiddenElements, f => includeHiddenElements);
}
#endregion
}
@@ -29,7 +29,6 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Directories.Queries.G
[ExcludeFromCodeCoverage]
public class GetDirectoryTreeQueryHandlerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IFixture _fixture;
private readonly IDriveService _mockDriveService;
private readonly IDirectoryService _mockDirectoryService;
@@ -40,9 +39,7 @@ public class GetDirectoryTreeQueryHandlerTests
private readonly DirectoryFixture _directoryFixture;
private readonly PathSegmentFixture _pathSegmentFixture;
private readonly FileFixture _fileFixture;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetDirectoryTreeQueryHandlerTests"/> class.
/// </summary>
@@ -59,9 +56,7 @@ public class GetDirectoryTreeQueryHandlerTests
_pathSegmentFixture = new PathSegmentFixture();
_fileFixture = new FileFixture();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task Handle_WhenCalledWithValidQueryAndNoIncludeFiles_ShouldReturnSuccessResult()
{
@@ -391,5 +386,4 @@ public class GetDirectoryTreeQueryHandlerTests
result.Value.First().Children.Should().HaveCount(2);
_mockDirectoryService.Received(1).GetSubdirectories(Arg.Any<string>(), false);
}
#endregion
}
@@ -14,11 +14,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Directories.Queries.G
[ExcludeFromCodeCoverage]
public class GetDirectoryTreeQueryValidatorTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly GetDirectoryTreeQueryValidator _validator;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetDirectoryTreeQueryValidatorTests"/> class.
/// </summary>
@@ -26,9 +23,7 @@ public class GetDirectoryTreeQueryValidatorTests
{
_validator = new GetDirectoryTreeQueryValidator();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
{
@@ -143,5 +138,4 @@ public class GetDirectoryTreeQueryValidatorTests
// Assert
result.ShouldNotHaveValidationErrorFor(x => x.IncludeFiles);
}
#endregion
}
@@ -12,7 +12,6 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Directories.Queries.G
[ExcludeFromCodeCoverage]
public class GetTreeDirectoriesQueryFixture
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid query to get tree directories.
/// </summary>
@@ -28,5 +27,4 @@ public class GetTreeDirectoriesQueryFixture
.RuleFor(x => x.Path, f => f.System.DirectoryPath())
.RuleFor(x => x.IncludeHiddenElements, f => includeHiddenElements);
}
#endregion
}
@@ -32,7 +32,6 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Directories.Queries.G
[ExcludeFromCodeCoverage]
public class GetTreeDirectoriesQueryHandlerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IFixture _fixture;
private readonly IMapper _mockMapper;
private readonly IDirectoryService _mockDirectoryService;
@@ -40,9 +39,7 @@ public class GetTreeDirectoriesQueryHandlerTests
private readonly GetTreeDirectoriesQueryFixture _getTreeDirectoriesQueryFixture;
private readonly DirectoryFixture _directoryFixture;
private readonly FileSystemTreeNodeResponseFixture _fileSystemTreeNodeResponseFixture;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetTreeDirectoriesQueryHandlerTests"/> class.
/// </summary>
@@ -56,9 +53,7 @@ public class GetTreeDirectoriesQueryHandlerTests
_directoryFixture = new DirectoryFixture();
_fileSystemTreeNodeResponseFixture = new FileSystemTreeNodeResponseFixture();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task Handle_WhenCalledWithValidQueryWithoutFilesIncluded_ShouldReturnSuccessResult()
{
@@ -170,5 +165,4 @@ public class GetTreeDirectoriesQueryHandlerTests
result.Value.Should().BeEquivalentTo(nestedResponses, options => options.IncludingNestedObjects());
result.Value.Any(r => r.Children.Count != 0).Should().BeTrue();
}
#endregion
}
@@ -14,11 +14,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Directories.Queries.G
[ExcludeFromCodeCoverage]
public class GetTreeDirectoriesQueryValidatorTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly GetTreeDirectoriesQueryValidator _validator;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetTreeDirectoriesQueryValidatorTests"/> class.
/// </summary>
@@ -26,9 +23,7 @@ public class GetTreeDirectoriesQueryValidatorTests
{
_validator = new GetTreeDirectoriesQueryValidator();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
{
@@ -115,5 +110,4 @@ public class GetTreeDirectoriesQueryValidatorTests
// Assert
result.ShouldNotHaveValidationErrorFor(x => x.IncludeHiddenElements);
}
#endregion
}
@@ -15,11 +15,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Drives.Queries.GetDri
[ExcludeFromCodeCoverage]
public class GetDrivesQueryFixture
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly Faker _faker = new();
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a single <see cref="FileSystemTreeNodeResponse"/> with a nested structure.
/// </summary>
@@ -58,5 +55,4 @@ public class GetDrivesQueryFixture
{
return Enumerable.Range(0, count).Select(_ => Create(0, maxDepth, maxChildren)).ToList();
}
#endregion
}
@@ -26,15 +26,12 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Drives.Queries.GetDri
[ExcludeFromCodeCoverage]
public class GetDrivesQueryHandlerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IFixture _fixture;
private readonly IMapper _mockMapper;
private readonly IDriveService _mockDriveService;
private readonly GetDrivesQueryHandler _sut;
private readonly GetDrivesQueryFixture _getDrivesQueryFixture;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetDrivesQueryHandlerTests"/> class.
/// </summary>
@@ -46,9 +43,7 @@ public class GetDrivesQueryHandlerTests
_sut = new GetDrivesQueryHandler(_mockDriveService, _mockMapper);
_getDrivesQueryFixture = new GetDrivesQueryFixture();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task Handle_WhenCalled_ShouldReturnSuccessResult()
{
@@ -119,5 +114,4 @@ public class GetDrivesQueryHandlerTests
_mockDriveService.Received(1).GetDrives();
_mockMapper.Received(1).Map<IEnumerable<FileSystemTreeNodeResponse>>(Arg.Any<IEnumerable<FileSystemItem>>());
}
#endregion
}
@@ -21,14 +21,11 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.FileSystem.Queries.Ge
[ExcludeFromCodeCoverage]
public class GetFileSystemQueryHandlerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IFixture _fixture;
private readonly IPlatformContextManager _mockPlatformContextManager;
private readonly IPlatformContext _mockPlatformContext;
private readonly GetFileSystemQueryHandler _sut;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetFileSystemQueryHandlerTests"/> class.
/// </summary>
@@ -40,9 +37,7 @@ public class GetFileSystemQueryHandlerTests
_mockPlatformContextManager.GetCurrentContext().Returns(_mockPlatformContext);
_sut = new GetFileSystemQueryHandler(_mockPlatformContextManager);
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Theory]
[InlineData(PlatformType.Unix)]
[InlineData(PlatformType.Windows)]
@@ -110,5 +105,4 @@ public class GetFileSystemQueryHandlerTests
await act.Should().NotThrowAsync();
_mockPlatformContextManager.Received(1).GetCurrentContext();
}
#endregion
}
@@ -18,11 +18,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Files.Fixtures;
[ExcludeFromCodeCoverage]
public class FileFixture
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly Faker _faker;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="FileFixture"/> class.
/// </summary>
@@ -30,9 +27,7 @@ public class FileFixture
{
_faker = new Faker();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid <see cref="File"/>.
/// </summary>
@@ -84,5 +79,4 @@ public class FileFixture
FileSystemItemStatus.Accessible
).Value;
}
#endregion
}
@@ -14,11 +14,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Files.Fixtures;
[ExcludeFromCodeCoverage]
public class FileResponseFixture
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly Faker _faker = new();
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid <see cref="FileResponse"/>.
/// </summary>
@@ -43,5 +40,4 @@ public class FileResponseFixture
{
return Enumerable.Range(0, count).Select(_ => Create()).ToList();
}
#endregion
}
@@ -12,7 +12,6 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Files.Queries.GetFile
[ExcludeFromCodeCoverage]
public class GetFilesQueryFixture
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid query to get files.
/// </summary>
@@ -28,5 +27,4 @@ public class GetFilesQueryFixture
.RuleFor(x => x.Path, f => f.System.FilePath())
.RuleFor(x => x.IncludeHiddenElements, f => includeHiddenElements);
}
#endregion
}
@@ -28,16 +28,13 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Files.Queries.GetFile
[ExcludeFromCodeCoverage]
public class GetFilesQueryHandlerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IFixture _fixture;
private readonly IMapper _mockMapper;
private readonly IFileService _mockFileService;
private readonly GetFilesQueryHandler _sut;
private readonly FileFixture _fileFixture;
private readonly FileResponseFixture _fileResponseFixture;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetFilesQueryHandlerTests"/> class.
/// </summary>
@@ -50,9 +47,7 @@ public class GetFilesQueryHandlerTests
_fileFixture = new FileFixture();
_fileResponseFixture = new FileResponseFixture();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task Handle_WhenCalledWithValidQueryWithoutHiddenFiles_ShouldReturnSuccessResult()
{
@@ -145,5 +140,4 @@ public class GetFilesQueryHandlerTests
_mockFileService.Received(1).GetFiles(query.Path, query.IncludeHiddenElements);
_mockMapper.Received(1).Map<IEnumerable<FileResponse>>(Arg.Is<IEnumerable<File>>(f => !f.Any()));
}
#endregion
}
@@ -14,11 +14,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Files.Queries.GetFile
[ExcludeFromCodeCoverage]
public class GetFilesQueryValidatorTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly GetFilesQueryValidator _validator;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetFilesQueryValidatorTests"/> class.
/// </summary>
@@ -26,9 +23,7 @@ public class GetFilesQueryValidatorTests
{
_validator = new GetFilesQueryValidator();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
{
@@ -115,5 +110,4 @@ public class GetFilesQueryValidatorTests
// Assert
result.ShouldNotHaveValidationErrorFor(x => x.IncludeHiddenElements);
}
#endregion
}
@@ -12,7 +12,6 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Files.Queries.GetTree
[ExcludeFromCodeCoverage]
public class GetTreeFilesQueryFixture
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid query to get files.
/// </summary>
@@ -28,5 +27,4 @@ public class GetTreeFilesQueryFixture
.RuleFor(x => x.Path, f => f.System.FilePath())
.RuleFor(x => x.IncludeHiddenElements, f => includeHiddenElements);
}
#endregion
}
@@ -27,16 +27,13 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Files.Queries.GetTree
[ExcludeFromCodeCoverage]
public class GetTreeFilesQueryHandlerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IFixture _fixture;
private readonly IMapper _mockMapper;
private readonly IFileService _mockFileService;
private readonly GetTreeFilesQueryHandler _sut;
private readonly FileFixture _fileFixture;
private readonly FileSystemTreeNodeResponseFixture _fileSystemTreeNodeResponseFixture;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetTreeFilesQueryHandler"/> class.
/// </summary>
@@ -49,9 +46,7 @@ public class GetTreeFilesQueryHandlerTests
_fileFixture = new FileFixture();
_fileSystemTreeNodeResponseFixture = new FileSystemTreeNodeResponseFixture();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task Handle_WhenCalledWithValidQueryWithoutHiddenFiles_ShouldReturnSuccessResult()
{
@@ -139,5 +134,4 @@ public class GetTreeFilesQueryHandlerTests
result.Value.Should().BeEmpty();
_mockFileService.Received(1).GetFiles(query.Path, query.IncludeHiddenElements);
}
#endregion
}
@@ -14,11 +14,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Files.Queries.GetTree
[ExcludeFromCodeCoverage]
public class GetTreeFilesQueryValidatorTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly GetTreeFilesQueryValidator _validator;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetTreeFilesQueryValidatorTests"/> class.
/// </summary>
@@ -26,9 +23,7 @@ public class GetTreeFilesQueryValidatorTests
{
_validator = new GetTreeFilesQueryValidator();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
{
@@ -115,5 +110,4 @@ public class GetTreeFilesQueryValidatorTests
// Assert
result.ShouldNotHaveValidationErrorFor(x => x.IncludeHiddenElements);
}
#endregion
}
@@ -21,13 +21,10 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Commands.Combine
[ExcludeFromCodeCoverage]
public class CombinePathCommandHandlerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IFixture _fixture;
private readonly IPathService _mockPathService;
private readonly CombinePathCommandHandler _sut;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="CombinePathCommandHandlerTests"/> class.
/// </summary>
@@ -37,9 +34,7 @@ public class CombinePathCommandHandlerTests
_mockPathService = Substitute.For<IPathService>();
_sut = new CombinePathCommandHandler(_mockPathService);
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task Handle_WhenCalledWithValidCommand_ShouldReturnSuccessResult()
{
@@ -95,5 +90,4 @@ public class CombinePathCommandHandlerTests
result.Value.Path.Should().BeEmpty();
_mockPathService.Received(1).CombinePath(command.OriginalPath, command.NewPath);
}
#endregion
}
@@ -14,11 +14,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Commands.Combine
[ExcludeFromCodeCoverage]
public class CombinePathCommandValidatorTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly CombinePathCommandValidator _validator;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="CombinePathCommandValidatorTests"/> class.
/// </summary>
@@ -26,9 +23,7 @@ public class CombinePathCommandValidatorTests
{
_validator = new CombinePathCommandValidator();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public void Validate_WhenOriginalPathIsNull_ShouldHaveValidationError()
{
@@ -133,5 +128,4 @@ public class CombinePathCommandValidatorTests
result.ShouldNotHaveValidationErrorFor(x => x.OriginalPath);
result.ShouldNotHaveValidationErrorFor(x => x.NewPath);
}
#endregion
}
@@ -12,7 +12,6 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Commands.Combine
[ExcludeFromCodeCoverage]
public class CombinePathCommandFixture
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid command to combine paths.
/// </summary>
@@ -27,5 +26,4 @@ public class CombinePathCommandFixture
.RuleFor(x => x.OriginalPath, f => f.System.FilePath())
.RuleFor(x => x.NewPath, f => f.System.FilePath());
}
#endregion
}
@@ -12,7 +12,6 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Commands.SplitPa
[ExcludeFromCodeCoverage]
public class SplitPathCommandFixture
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid command for splitting paths.
/// </summary>
@@ -25,5 +24,4 @@ public class SplitPathCommandFixture
))
.RuleFor(x => x.Path, f => f.System.FilePath());
}
#endregion
}
@@ -29,7 +29,6 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Commands.SplitPa
[ExcludeFromCodeCoverage]
public class SplitPathCommandHandlerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IFixture _fixture;
private readonly IMapper _mockMapper;
private readonly IPathService _mockPathService;
@@ -38,9 +37,7 @@ public class SplitPathCommandHandlerTests
private readonly PathSegmentResponseFixture _pathSegmentResponseFixture;
private readonly PathSegmentMappingConfig _pathSegmentMappingConfig;
private readonly TypeAdapterConfig _config;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="SplitPathCommandHandlerTests"/> class.
/// </summary>
@@ -57,9 +54,7 @@ public class SplitPathCommandHandlerTests
_pathSegmentMappingConfig = new PathSegmentMappingConfig();
_pathSegmentMappingConfig.Register(_config);
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task Handle_WhenCalledWithValidCommand_ShouldReturnSuccessResult()
{
@@ -126,5 +121,4 @@ public class SplitPathCommandHandlerTests
_mockPathService.Received(1).ParsePath(command.Path);
_mockMapper.Received(1).Map<IEnumerable<PathSegmentResponse>>(Arg.Any<IEnumerable<PathSegment>>());
}
#endregion
}
@@ -14,11 +14,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Commands.SplitPa
[ExcludeFromCodeCoverage]
public class SplitPathCommandValidatorTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly SplitPathCommandValidator _validator;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="SplitPathCommandValidatorTests"/> class.
/// </summary>
@@ -26,9 +23,7 @@ public class SplitPathCommandValidatorTests
{
_validator = new SplitPathCommandValidator();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
{
@@ -87,5 +82,4 @@ public class SplitPathCommandValidatorTests
// Assert
result.ShouldNotHaveValidationErrorFor(x => x.Path);
}
#endregion
}
@@ -16,11 +16,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Fixtures;
[ExcludeFromCodeCoverage]
public class PathSegmentFixture
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly Faker _faker;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="PathSegmentFixture"/> class.
/// </summary>
@@ -28,9 +25,7 @@ public class PathSegmentFixture
{
_faker = new Faker();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid <see cref="PathSegment"/>.
/// </summary>
@@ -60,5 +55,4 @@ public class PathSegmentFixture
{
return Enumerable.Range(0, count).Select(_ => CreatePathSegment()).ToList();
}
#endregion
}
@@ -14,11 +14,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Fixtures;
[ExcludeFromCodeCoverage]
public class PathSegmentResponseFixture
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly Faker _faker = new();
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid <see cref="PathSegmentResponse"/>.
/// </summary>
@@ -37,5 +34,4 @@ public class PathSegmentResponseFixture
{
return Enumerable.Range(0, count).Select(_ => Create()).ToList();
}
#endregion
}
@@ -14,11 +14,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Fixtures;
[ExcludeFromCodeCoverage]
public class PathSeparatorResponseFixture
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly Faker _faker = new();
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid <see cref="PathSeparatorResponse"/>.
/// </summary>
@@ -37,5 +34,4 @@ public class PathSeparatorResponseFixture
{
return Enumerable.Range(0, count).Select(_ => Create()).ToList();
}
#endregion
}
@@ -18,12 +18,9 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Queries.CheckPat
[ExcludeFromCodeCoverage]
public class CheckPathExistsQueryHandlerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IPathService _mockPathService;
private readonly CheckPathExistsQueryHandler _sut;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="CheckPathExistsQueryHandlerTests"/> class.
/// </summary>
@@ -32,9 +29,7 @@ public class CheckPathExistsQueryHandlerTests
_mockPathService = Substitute.For<IPathService>();
_sut = new CheckPathExistsQueryHandler(_mockPathService);
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task Handle_WhenPathExistsAndIsNotHidden_ShouldReturnTrueResponse()
{
@@ -125,5 +120,4 @@ public class CheckPathExistsQueryHandlerTests
result.Exists.Should().BeTrue();
_mockPathService.Received(1).Exists(query.Path);
}
#endregion
}
@@ -14,11 +14,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Queries.CheckPat
[ExcludeFromCodeCoverage]
public class CheckPathExistsQueryValidatorTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly CheckPathExistsQueryValidator _validator;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="CheckPathExistsQueryValidatorTests"/> class.
/// </summary>
@@ -26,9 +23,7 @@ public class CheckPathExistsQueryValidatorTests
{
_validator = new CheckPathExistsQueryValidator();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
{
@@ -87,5 +82,4 @@ public class CheckPathExistsQueryValidatorTests
// Assert
result.ShouldNotHaveValidationErrorFor(x => x.Path);
}
#endregion
}
@@ -12,7 +12,6 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Queries.CheckPat
[ExcludeFromCodeCoverage]
public class CheckPathExistsQueryFixture
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid query to check if paths exist.
/// </summary>
@@ -28,5 +27,4 @@ public class CheckPathExistsQueryFixture
.RuleFor(x => x.Path, f => f.System.FilePath())
.RuleFor(x => x.IncludeHiddenElements, includeHiddenElements);
}
#endregion
}
@@ -12,7 +12,6 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Queries.GetPathP
[ExcludeFromCodeCoverage]
public class GetPathParentQueryFixture
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid query to check if paths exist.
/// </summary>
@@ -25,5 +24,4 @@ public class GetPathParentQueryFixture
))
.RuleFor(x => x.Path, f => f.System.FilePath());
}
#endregion
}
@@ -26,16 +26,13 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Queries.GetPathP
[ExcludeFromCodeCoverage]
public class GetPathParentQueryHandlerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IFixture _fixture;
private readonly IMapper _mockMapper;
private readonly IPathService _mockPathService;
private readonly GetPathParentQueryHandler _sut;
private readonly PathSegmentFixture _pathSegmentFixture;
private readonly PathSegmentResponseFixture _pathSegmentResponseFixture;
#endregion
#region ====================================================================== CTOR =====================================================================================
public GetPathParentQueryHandlerTests()
{
_fixture = new Fixture().Customize(new AutoNSubstituteCustomization());
@@ -45,9 +42,7 @@ public class GetPathParentQueryHandlerTests
_pathSegmentFixture = new PathSegmentFixture();
_pathSegmentResponseFixture = new PathSegmentResponseFixture();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task Handle_WhenCalledWithValidQuery_ShouldReturnSuccessResult()
{
@@ -114,5 +109,4 @@ public class GetPathParentQueryHandlerTests
_mockPathService.Received(1).GoUpOneLevel(query.Path);
_mockMapper.Received(1).Map<IEnumerable<PathSegmentResponse>>(Arg.Is<IEnumerable<PathSegment>>(p => !p.Any()));
}
#endregion
}
@@ -14,11 +14,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Queries.GetPathP
[ExcludeFromCodeCoverage]
public class GetPathParentQueryValidatorTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly GetPathParentQueryValidator _validator;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetPathParentQueryValidatorTests"/> class.
/// </summary>
@@ -26,9 +23,7 @@ public class GetPathParentQueryValidatorTests
{
_validator = new GetPathParentQueryValidator();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
{
@@ -87,5 +82,4 @@ public class GetPathParentQueryValidatorTests
// Assert
result.ShouldNotHaveValidationErrorFor(x => x.Path);
}
#endregion
}
@@ -12,7 +12,6 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Queries.GetPathR
[ExcludeFromCodeCoverage]
public class GetPathRootQueryFixture
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid query to check if paths exist.
/// </summary>
@@ -25,5 +24,4 @@ public class GetPathRootQueryFixture
))
.RuleFor(x => x.Path, f => f.System.FilePath());
}
#endregion
}
@@ -24,16 +24,13 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Queries.GetPathR
[ExcludeFromCodeCoverage]
public class GetPathRootQueryHandlerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IFixture _fixture;
private readonly IMapper _mockMapper;
private readonly IPathService _mockPathService;
private readonly GetPathRootQueryHandler _sut;
private readonly PathSegmentFixture _pathSegmentFixture;
private readonly PathSegmentResponseFixture _pathSegmentResponseFixture;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetPathRootQueryHandlerTests"/> class.
/// </summary>
@@ -46,9 +43,7 @@ public class GetPathRootQueryHandlerTests
_pathSegmentFixture = new PathSegmentFixture();
_pathSegmentResponseFixture = new PathSegmentResponseFixture();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task Handle_WhenCalledWithValidQuery_ShouldReturnSuccessResult()
{
@@ -115,5 +110,4 @@ public class GetPathRootQueryHandlerTests
_mockPathService.Received(1).GetPathRoot(query.Path);
_mockMapper.Received(1).Map<PathSegmentResponse>(Arg.Is<PathSegment>(p => p == rootPathSegment));
}
#endregion
}
@@ -14,11 +14,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Queries.GetPathR
[ExcludeFromCodeCoverage]
public class GetPathRootQueryValidatorTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly GetPathRootQueryValidator _validator;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetPathRootQueryValidatorTests"/> class.
/// </summary>
@@ -26,9 +23,7 @@ public class GetPathRootQueryValidatorTests
{
_validator = new GetPathRootQueryValidator();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
{
@@ -87,5 +82,4 @@ public class GetPathRootQueryValidatorTests
// Assert
result.ShouldNotHaveValidationErrorFor(x => x.Path);
}
#endregion
}
@@ -18,12 +18,9 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Queries.GetPathS
[ExcludeFromCodeCoverage]
public class GetPathSeparatorQueryHandlerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IPathService _mockPathService;
private readonly GetPathSeparatorQueryHandler _sut;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetPathSeparatorQueryHandlerTests"/> class.
/// </summary>
@@ -32,9 +29,7 @@ public class GetPathSeparatorQueryHandlerTests
_mockPathService = Substitute.For<IPathService>();
_sut = new GetPathSeparatorQueryHandler(_mockPathService);
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task Handle_WhenCalled_ShouldReturnPathSeparatorResponse()
{
@@ -101,5 +96,4 @@ public class GetPathSeparatorQueryHandlerTests
// Assert
await act.Should().NotThrowAsync();
}
#endregion
}
@@ -12,7 +12,6 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Queries.Validate
[ExcludeFromCodeCoverage]
public class ValidatePathQueryFixure
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid query to check if paths exist.
/// </summary>
@@ -25,5 +24,4 @@ public class ValidatePathQueryFixure
))
.RuleFor(x => x.Path, f => f.System.FilePath());
}
#endregion
}
@@ -18,12 +18,9 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Queries.Validate
[ExcludeFromCodeCoverage]
public class ValidatePathQueryHandlerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IPathService _mockPathService;
private readonly ValidatePathQueryHandler _sut;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="ValidatePathQueryHandlerTests"/> class.
/// </summary>
@@ -32,9 +29,7 @@ public class ValidatePathQueryHandlerTests
_mockPathService = Substitute.For<IPathService>();
_sut = new ValidatePathQueryHandler(_mockPathService);
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task Handle_WhenCalledWithValidPath_ShouldReturnTrueResponse()
{
@@ -94,5 +89,4 @@ public class ValidatePathQueryHandlerTests
result.IsValid.Should().BeFalse();
_mockPathService.Received(1).IsValidPath(Arg.Any<string>());
}
#endregion
}
@@ -14,11 +14,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Pahs.Queries.Validate
[ExcludeFromCodeCoverage]
public class ValidatePathQueryValidatorTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly ValidatePathQueryValidator _validator;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="ValidatePathQueryValidatorTests"/> class.
/// </summary>
@@ -26,9 +23,7 @@ public class ValidatePathQueryValidatorTests
{
_validator = new ValidatePathQueryValidator();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
{
@@ -87,5 +82,4 @@ public class ValidatePathQueryValidatorTests
// Assert
result.ShouldNotHaveValidationErrorFor(x => x.Path);
}
#endregion
}
@@ -13,7 +13,6 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Thumbnails.Fixtures;
[ExcludeFromCodeCoverage]
public class ThumbnailResponseFixture
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid query to get a thumbnail.
/// </summary>
@@ -28,5 +27,4 @@ public class ThumbnailResponseFixture
.RuleFor(x => x.Type, f => f.PickRandom<ImageType>())
.RuleFor(x => x.Bytes, f => f.Random.Bytes(20));
}
#endregion
}
@@ -12,7 +12,6 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Thumbnails.Queries.Ge
[ExcludeFromCodeCoverage]
public class GetThumbnailQueryFixture
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid query to get a thumbnail.
/// </summary>
@@ -27,5 +26,4 @@ public class GetThumbnailQueryFixture
.RuleFor(x => x.Path, f => f.System.FilePath())
.RuleFor(x => x.Quality, f => f.Random.Int());
}
#endregion
}
@@ -23,14 +23,11 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Thumbnails.Queries.Ge
[ExcludeFromCodeCoverage]
public class GetThumbnailQueryHandlerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IFixture _fixture;
private readonly IThumbnailService _mockThumbnailService;
private readonly IMapper _mockMapper;
private readonly GetThumbnailQueryHandler _sut;
#endregion
#region ====================================================================== CTOR =====================================================================================
public GetThumbnailQueryHandlerTests()
{
_fixture = new Fixture().Customize(new AutoNSubstituteCustomization());
@@ -38,9 +35,7 @@ public class GetThumbnailQueryHandlerTests
_mockMapper = Substitute.For<IMapper>();
_sut = new GetThumbnailQueryHandler(_mockThumbnailService, _mockMapper);
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task Handle_WhenCalledWithValidQuery_ShouldReturnSuccessResult()
{
@@ -100,5 +95,4 @@ public class GetThumbnailQueryHandlerTests
await _mockThumbnailService.Received(1).GetThumbnailAsync(query.Path, query.Quality, cts.Token);
_mockMapper.DidNotReceive().Map<ThumbnailResponse>(Arg.Any<Thumbnail>());
}
#endregion
}
@@ -13,11 +13,8 @@ namespace Lumina.Application.UnitTests.Core.FileManagement.Thumbnails.Queries.Ge
[ExcludeFromCodeCoverage]
public class GetThumbnailQueryValidatorTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly GetThumbnailQueryValidator _validator;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="GetThumbnailQueryValidatorTests"/> class.
/// </summary>
@@ -25,9 +22,7 @@ public class GetThumbnailQueryValidatorTests
{
_validator = new GetThumbnailQueryValidator();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public void Validate_WhenPathIsNull_ShouldHaveValidationError()
{
@@ -106,5 +101,4 @@ public class GetThumbnailQueryValidatorTests
result.ShouldNotHaveValidationErrorFor(x => x.Quality);
}
#endregion
}
@@ -29,16 +29,13 @@ namespace Lumina.Application.UnitTests.Core.WrittenContentLibrary.BooksLibrary.B
[ExcludeFromCodeCoverage]
public class AddBookCommandHandlerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IFixture _fixture;
private readonly IUnitOfWork _mockUnitOfWork;
private readonly IMapper _mockMapper;
private readonly IBookRepository _mockBookRepository;
private readonly AddBookCommandHandler _sut;
private readonly AddBookCommandFixture _commandBookFixture;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="AddBookCommandHandlerTests"/> class.
/// </summary>
@@ -57,9 +54,7 @@ public class AddBookCommandHandlerTests
_sut = new AddBookCommandHandler(_mockUnitOfWork, _mockMapper);
_commandBookFixture = new AddBookCommandFixture();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task Handle_WhenCalledWithValidCommand_ShouldReturnSuccessResult()
{
@@ -274,5 +269,4 @@ public class AddBookCommandHandlerTests
await _mockBookRepository.DidNotReceive().InsertAsync(Arg.Any<BookModel>(), Arg.Any<CancellationToken>());
await _mockUnitOfWork.DidNotReceive().SaveChangesAsync(Arg.Any<CancellationToken>());
}
#endregion
}
@@ -18,12 +18,9 @@ namespace Lumina.Application.UnitTests.Core.WrittenContentLibrary.BooksLibrary.B
[ExcludeFromCodeCoverage]
public class AddBookCommandValidatorTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly AddBookCommandFixture _commandBookFixture;
private readonly AddBookCommandValidator _validator;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="AddBookCommandValidatorTests"/> class.
/// </summary>
@@ -32,9 +29,7 @@ public class AddBookCommandValidatorTests
_validator = new AddBookCommandValidator();
_commandBookFixture = new AddBookCommandFixture();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public void Validate_WhenTitleIsNull_ShouldHaveValidationError()
{
@@ -1893,5 +1888,4 @@ public class AddBookCommandValidatorTests
// Assert
result.ShouldNotHaveValidationErrorFor(x => x.Ratings[0].VoteCount);
}
#endregion
}
@@ -22,13 +22,10 @@ namespace Lumina.Application.UnitTests.Core.WrittenContentLibrary.BooksLibrary.B
[ExcludeFromCodeCoverage]
public class AddBookCommandFixture
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly Fixture _fixture;
private readonly Random _random = new();
private readonly Faker _faker;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="AddBookCommandFixture"/> class.
/// </summary>
@@ -39,9 +36,7 @@ public class AddBookCommandFixture
_fixture.Customizations.Add(new NullableDateOnlySpecimenBuilder());
_faker = new Faker();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a random valid command to add a book.
/// </summary>
@@ -343,5 +338,4 @@ public class AddBookCommandFixture
{
return input?.Length > maxLength ? input[..maxLength] : input;
}
#endregion
}