Inlines fixtures instantiation.

This commit is contained in:
BinaryAlley committed 2026-08-15 03:19:51 -07:00
1 parent b648e2f054
commit 59e16d645a
147 files changed
+190 -898

No files matched your search

@@ -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]
@@ -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()
@@ -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]
@@ -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()
@@ -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([]);
@@ -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()
@@ -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]
@@ -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()
@@ -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]
@@ -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()
@@ -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);
@@ -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()