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

@@ -21,13 +21,10 @@ namespace Lumina.Presentation.Api.UnitTests.Core.Controllers.Common;
[ExcludeFromCodeCoverage]
public class ApiControllerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly ApiControllerFixture _sut;
private readonly HttpContext _mockHttpContext;
private readonly ProblemDetailsFactory _mockProblemDetailsFactory;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="ApiControllerTests"/> class.
/// </summary>
@@ -42,9 +39,7 @@ public class ApiControllerTests
};
_sut.ProblemDetailsFactory = _mockProblemDetailsFactory;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public void Problem_WhenCalledWithNoErrors_ShouldReturnGenericProblem()
{
@@ -280,5 +275,4 @@ public class ApiControllerTests
validationProblem.Errors["Code1"].Should().Contain("Description1");
validationProblem.Errors["Code2"].Should().Contain("Description2");
}
#endregion
}
@@ -14,7 +14,6 @@ namespace Lumina.Presentation.Api.UnitTests.Core.Controllers.Common.Fixtures;
[ExcludeFromCodeCoverage]
public class ApiControllerFixture : ApiController
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Returns a standardized error response using the <see cref="ProblemDetails"/> format.
/// </summary>
@@ -34,5 +33,4 @@ public class ApiControllerFixture : ApiController
{
return ValidationProblem(errors);
}
#endregion
}
@@ -27,14 +27,11 @@ namespace Lumina.Presentation.Api.UnitTests.Core.Controllers.FileManagement;
[ExcludeFromCodeCoverage]
public class DirectoriesControllerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IFixture _fixture;
private readonly ISender _mockMediator;
private readonly DirectoriesController _sut;
private readonly FileSystemTreeNodeResponseFixture _fileSystemTreeNodeResponseFixture;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="DirectoriesControllerTests"/> class.
/// </summary>
@@ -45,9 +42,7 @@ public class DirectoriesControllerTests
_sut = new DirectoriesController(_mockMediator);
_fileSystemTreeNodeResponseFixture = new FileSystemTreeNodeResponseFixture();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task GetDirectoryTree_WhenCalled_ShouldReturnFileSystemTreeNodeResponses()
{
@@ -230,5 +225,4 @@ public class DirectoriesControllerTests
List<DirectoryResponse> actualResponses = await result.ToListAsync();
actualResponses.Should().BeEmpty();
}
#endregion
}
@@ -27,13 +27,10 @@ namespace Lumina.Presentation.Api.UnitTests.Core.Controllers.FileManagement;
[ExcludeFromCodeCoverage]
public class DrivesControllerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly ISender _mockMediator;
private readonly DrivesController _sut;
private readonly FileSystemTreeNodeResponseFixture _fileSystemTreeNodeResponseFixture;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="DrivesControllerTests"/> class.
/// </summary>
@@ -43,9 +40,7 @@ public class DrivesControllerTests
_sut = new DrivesController(_mockMediator);
_fileSystemTreeNodeResponseFixture = new FileSystemTreeNodeResponseFixture();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task GetDrives_WhenCalled_ShouldReturnOkResultWithFileSystemTreeNodeResponses()
{
@@ -142,5 +137,4 @@ public class DrivesControllerTests
cts.CancelAfter(50);
await Assert.ThrowsAnyAsync<OperationCanceledException>(() => _sut.GetDrives(cts.Token));
}
#endregion
}
@@ -21,12 +21,9 @@ namespace Lumina.Presentation.Api.UnitTests.Core.Controllers.FileManagement;
[ExcludeFromCodeCoverage]
public class FileSystemControllerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly ISender _mockMediator;
private readonly FileSystemController _sut;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="FileSystemControllerTests"/> class.
/// </summary>
@@ -35,9 +32,7 @@ public class FileSystemControllerTests
_mockMediator = Substitute.For<ISender>();
_sut = new FileSystemController(_mockMediator);
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task GetType_WhenCalled_ShouldReturnOkResultWithFileSystemTypeResponse()
{
@@ -108,5 +103,4 @@ public class FileSystemControllerTests
cts.CancelAfter(50);
await Assert.ThrowsAnyAsync<OperationCanceledException>(() => _sut.GetType(cts.Token));
}
#endregion
}
@@ -27,14 +27,11 @@ namespace Lumina.Presentation.Api.UnitTests.Core.Controllers.FileManagement;
[ExcludeFromCodeCoverage]
public class FilesControllerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IFixture _fixture;
private readonly ISender _mockMediator;
private readonly FilesController _sut;
private readonly FileSystemTreeNodeResponseFixture _fileSystemTreeNodeResponseFixture;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="FilesControllerTests"/> class.
/// </summary>
@@ -45,9 +42,7 @@ public class FilesControllerTests
_sut = new FilesController(_mockMediator);
_fileSystemTreeNodeResponseFixture = new FileSystemTreeNodeResponseFixture();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task GetTreeFiles_WhenCalled_ShouldReturnFileSystemTreeNodeResponses()
{
@@ -167,5 +162,4 @@ public class FilesControllerTests
List<FileResponse> actualResponses = await result.ToListAsync();
actualResponses.Should().BeEmpty();
}
#endregion
}
@@ -15,11 +15,8 @@ namespace Lumina.Presentation.Api.UnitTests.Core.Controllers.FileManagement.Fixt
[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
}
@@ -14,11 +14,8 @@ namespace Lumina.Presentation.Api.UnitTests.Core.Controllers.FileManagement.Fixt
[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.Presentation.Api.UnitTests.Core.Controllers.FileManagement.Fixt
[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
}
@@ -13,7 +13,6 @@ namespace Lumina.Presentation.Api.UnitTests.Core.Controllers.FileManagement.Fixt
[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
}
@@ -33,14 +33,11 @@ namespace Lumina.Presentation.Api.UnitTests.Core.Controllers.FileManagement;
[ExcludeFromCodeCoverage]
public class PathControllerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly ISender _mockMediator;
private readonly PathController _sut;
private readonly PathSegmentResponseFixture _pathSegmentResponseFixture;
private readonly PathSeparatorResponseFixture _pathSeparatorResponseFixture;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="PathControllerTests"/> class.
/// </summary>
@@ -51,9 +48,7 @@ public class PathControllerTests
_pathSegmentResponseFixture = new PathSegmentResponseFixture();
_pathSeparatorResponseFixture = new PathSeparatorResponseFixture();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task GetPathRoot_WhenCalled_ShouldReturnOkResultWithPathSegmentResponse()
{
@@ -676,5 +671,4 @@ public class PathControllerTests
cts.CancelAfter(50);
await Assert.ThrowsAnyAsync<OperationCanceledException>(() => _sut.CheckPathExists(path, true, cts.Token));
}
#endregion
}
@@ -29,12 +29,9 @@ namespace Lumina.Presentation.Api.UnitTests.Core.Controllers.FileManagement;
[ExcludeFromCodeCoverage]
public class ThumbnailsControllerTests
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly ISender _mockMediator;
private readonly ThumbnailsController _sut;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="ThumbnailsControllerTests"/> class.
/// </summary>
@@ -43,9 +40,7 @@ public class ThumbnailsControllerTests
_mockMediator = Substitute.For<ISender>();
_sut = new ThumbnailsController(_mockMediator);
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task GetThumbnail_WhenCalled_ShouldReturnFileResultWithThumbnailResponse()
{
@@ -150,5 +145,4 @@ public class ThumbnailsControllerTests
cts.CancelAfter(50);
await Assert.ThrowsAnyAsync<OperationCanceledException>(() => _sut.GetThumbnail(path, quality, cts.Token));
}
#endregion
}