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

@@ -26,7 +26,6 @@ namespace Lumina.Presentation.Api.IntegrationTests.Core.Controllers.FileManageme
[ExcludeFromCodeCoverage]
public class DirectoriesControllerTests : IClassFixture<LuminaApiFactory>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly HttpClient _client;
private readonly JsonSerializerOptions _jsonOptions = new()
{
@@ -35,9 +34,7 @@ public class DirectoriesControllerTests : IClassFixture<LuminaApiFactory>
Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) }
};
private static readonly bool s_isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="DirectoriesControllerTests"/> class.
/// </summary>
@@ -46,9 +43,7 @@ public class DirectoriesControllerTests : IClassFixture<LuminaApiFactory>
{
_client = apiFactory.CreateClient();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task GetDirectoryTree_WhenCalledWithValidPathAndIncludeFilesAndNotIncludeHiddenElements_ShouldReturnDirectoryTreeWithFilesAndNotHiddenElements()
{
@@ -641,5 +636,4 @@ public class DirectoriesControllerTests : IClassFixture<LuminaApiFactory>
fileSystemFixture.CleanupFileSystemStructure();
}
}
#endregion
}
@@ -24,7 +24,6 @@ namespace Lumina.Presentation.Api.IntegrationTests.Core.Controllers.FileManageme
[ExcludeFromCodeCoverage]
public class DrivesControllerTests : IClassFixture<LuminaApiFactory>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly HttpClient _client;
private readonly JsonSerializerOptions _jsonOptions = new()
{
@@ -33,9 +32,7 @@ public class DrivesControllerTests : IClassFixture<LuminaApiFactory>
Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) }
};
private static readonly bool s_isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="DrivesControllerTests"/> class.
/// </summary>
@@ -44,9 +41,7 @@ public class DrivesControllerTests : IClassFixture<LuminaApiFactory>
{
_client = apiFactory.CreateClient();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task GetDrives_WhenCalled_ShouldReturnDrives()
@@ -81,5 +76,4 @@ public class DrivesControllerTests : IClassFixture<LuminaApiFactory>
firstDrive.ItemType.Should().Be(FileSystemItemType.Root);
drives.Count.Should().BeGreaterThanOrEqualTo(1);
}
#endregion
}
@@ -25,7 +25,6 @@ namespace Lumina.Presentation.Api.IntegrationTests.Core.Controllers.FileManageme
[ExcludeFromCodeCoverage]
public class FileSystemControllerTests : IClassFixture<LuminaApiFactory>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly HttpClient _client;
private readonly JsonSerializerOptions _jsonOptions = new()
{
@@ -33,9 +32,7 @@ public class FileSystemControllerTests : IClassFixture<LuminaApiFactory>
PropertyNameCaseInsensitive = true,
Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) }
};
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="FileSystemControllerTests"/> class.
/// </summary>
@@ -44,9 +41,7 @@ public class FileSystemControllerTests : IClassFixture<LuminaApiFactory>
{
_client = apiFactory.CreateClient();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task GetType_WhenCalled_ShouldReturnOkResultWithFileSystemTypeResponse()
{
@@ -95,5 +90,4 @@ public class FileSystemControllerTests : IClassFixture<LuminaApiFactory>
// Assert
await act.Should().NotThrowAsync();
}
#endregion
}
@@ -25,7 +25,6 @@ namespace Lumina.Presentation.Api.IntegrationTests.Core.Controllers.FileManageme
[ExcludeFromCodeCoverage]
public class FilesControllerTests : IClassFixture<LuminaApiFactory>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly HttpClient _client;
private readonly JsonSerializerOptions _jsonOptions = new()
{
@@ -34,9 +33,7 @@ public class FilesControllerTests : IClassFixture<LuminaApiFactory>
Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) }
};
private static readonly bool s_isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="FilesControllerTests"/> class.
/// </summary>
@@ -45,9 +42,7 @@ public class FilesControllerTests : IClassFixture<LuminaApiFactory>
{
_client = apiFactory.CreateClient();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task GetTreeFiles_WhenCalledWithValidPathAndNotIncludeHiddenElements_ShouldReturnTreeFilesWithoutHiddenElements()
{
@@ -331,5 +326,4 @@ public class FilesControllerTests : IClassFixture<LuminaApiFactory>
fileSystemFixture.CleanupFileSystemStructure();
}
}
#endregion
}
@@ -13,12 +13,9 @@ namespace Lumina.Presentation.Api.IntegrationTests.Core.Controllers.FileManageme
[ExcludeFromCodeCoverage]
public class FileSystemStructureFixture
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly string _rootPath;
private readonly Faker _faker = new();
#endregion
#region ===================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="FileSystemStructureFixture"/> class.
/// </summary>
@@ -26,9 +23,7 @@ public class FileSystemStructureFixture
{
_rootPath = Path.Combine(AppContext.BaseDirectory, "TestFileSystemStructure_" + Guid.NewGuid());
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a file system structure with three nested directories, each containing two text files.
@@ -93,5 +88,4 @@ public class FileSystemStructureFixture
if (Directory.Exists(_rootPath))
Directory.Delete(_rootPath, recursive: true);
}
#endregion
}
@@ -15,11 +15,8 @@ namespace Lumina.Presentation.Api.IntegrationTests.Core.Controllers.FileManageme
[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
}
@@ -15,14 +15,11 @@ namespace Lumina.Presentation.Api.IntegrationTests.Core.Controllers.FileManageme
[ExcludeFromCodeCoverage]
public class TestImageFixture : IDisposable
{
#region ==================================================================== PROPERTIES =================================================================================
/// <summary>
/// Gets the path of the created test image.
/// </summary>
public string ImagePath { get; }
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="TestImageFixture"/> class.
/// </summary>
@@ -31,9 +28,7 @@ public class TestImageFixture : IDisposable
ImagePath = Path.Combine(Path.GetTempPath(), $"TestImage_{Guid.NewGuid()}.jpg");
CreateTestImage();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Creates a test image file.
/// </summary>
@@ -51,5 +46,4 @@ public class TestImageFixture : IDisposable
if (File.Exists(ImagePath))
File.Delete(ImagePath);
}
#endregion
}
@@ -26,7 +26,6 @@ namespace Lumina.Presentation.Api.IntegrationTests.Core.Controllers.FileManageme
[ExcludeFromCodeCoverage]
public class PathControllerTests : IClassFixture<LuminaApiFactory>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly HttpClient _client;
private readonly JsonSerializerOptions _jsonOptions = new()
{
@@ -35,9 +34,7 @@ public class PathControllerTests : IClassFixture<LuminaApiFactory>
Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) }
};
private static readonly bool s_isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="PathControllerTests"/> class.
/// </summary>
@@ -46,9 +43,7 @@ public class PathControllerTests : IClassFixture<LuminaApiFactory>
{
_client = apiFactory.CreateClient();
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task GetPathRoot_WhenCalledWithValidPath_ShouldReturnOkResultWithPathSegmentResponse()
{
@@ -636,5 +631,4 @@ public class PathControllerTests : IClassFixture<LuminaApiFactory>
// Assert
await act.Should().ThrowAsync<TaskCanceledException>();
}
#endregion
}
@@ -21,7 +21,6 @@ namespace Lumina.Presentation.Api.IntegrationTests.Core.Controllers.FileManageme
[ExcludeFromCodeCoverage]
public class ThumbnailsControllerTests : IClassFixture<LuminaApiFactory>, IClassFixture<TestImageFixture>
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly HttpClient _client;
private readonly JsonSerializerOptions _jsonOptions = new()
{
@@ -30,9 +29,7 @@ public class ThumbnailsControllerTests : IClassFixture<LuminaApiFactory>, IClass
Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) }
};
private readonly string _testImagePath;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="ThumbnailsControllerTests"/> class.
/// </summary>
@@ -43,9 +40,7 @@ public class ThumbnailsControllerTests : IClassFixture<LuminaApiFactory>, IClass
_client = apiFactory.CreateClient();
_testImagePath = imageFixture.ImagePath;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
[Fact]
public async Task GetThumbnail_WhenCalledWithValidPathAndQuality_ShouldReturnOkResultWithThumbnail()
{
@@ -132,5 +127,4 @@ public class ThumbnailsControllerTests : IClassFixture<LuminaApiFactory>, IClass
// Assert
await act.Should().ThrowAsync<TaskCanceledException>();
}
#endregion
}