mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 17:11:10 +00:00
eliminates region sections
This commit is contained in:
1 parent
705c02b90d
commit
405fc1ff9a
370 files changed
+47
-1618
No files matched your search
-2
@@ -20,7 +20,6 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entiti
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class DirectoryTests
|
||||
{
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void Create_WhenCalledWithValidParameters_ShouldReturnSuccessfulResult()
|
||||
{
|
||||
@@ -134,5 +133,4 @@ public class DirectoryTests
|
||||
result.IsError.Should().BeFalse();
|
||||
directory.Items.Should().NotContain(item);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-2
@@ -18,7 +18,6 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entiti
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class FileTests
|
||||
{
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void Create_WhenCalledWithValidParameters_ShouldReturnSuccessfulResult()
|
||||
{
|
||||
@@ -154,5 +153,4 @@ public class FileTests
|
||||
result.FirstError.Should().Be(Errors.FileManagement.NameCannotBeEmpty);
|
||||
file.Name.Should().Be("file.txt");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -19,11 +19,8 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entiti
|
||||
[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
|
||||
}
|
||||
-6
@@ -18,11 +18,8 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entiti
|
||||
[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
|
||||
}
|
||||
-2
@@ -15,7 +15,6 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entiti
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class UnixRootItemFixture
|
||||
{
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
/// <summary>
|
||||
/// Creates a random valid <see cref="UnixRootItem"/>.
|
||||
/// </summary>
|
||||
@@ -29,5 +28,4 @@ public class UnixRootItemFixture
|
||||
throw new InvalidOperationException("Failed to create UnixRootItem: " + string.Join(", ", unixRootItemResult.Errors));
|
||||
return unixRootItemResult.Value;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-2
@@ -17,7 +17,6 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entiti
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class UnixRootItemTests
|
||||
{
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void Create_WhenCalledWithDefaultStatus_ShouldReturnSuccessfulResult()
|
||||
{
|
||||
@@ -102,5 +101,4 @@ public class UnixRootItemTests
|
||||
result.FirstError.Should().Be(Errors.FileManagement.ParentNodeCannotBeNull);
|
||||
unixRootItem.Parent.HasValue.Should().BeFalse();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-2
@@ -18,7 +18,6 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entiti
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class WindowsRootItemTests
|
||||
{
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void Create_WhenCalledWithValidParameters_ShouldReturnSuccessfulResult()
|
||||
{
|
||||
@@ -144,5 +143,4 @@ public class WindowsRootItemTests
|
||||
result.FirstError.Should().Be(Errors.FileManagement.ParentNodeCannotBeNull);
|
||||
windowsRootItem.Parent.HasValue.Should().BeFalse();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -22,12 +22,9 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class FileSystemItemTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly IFixture _fixture;
|
||||
private readonly FileSystemPathIdFixture _fileSystemPathIdFixture;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FileSystemItemTests"/> class.
|
||||
/// </summary>
|
||||
@@ -36,9 +33,7 @@ public class FileSystemItemTests
|
||||
_fixture = new Fixture().Customize(new AutoNSubstituteCustomization());
|
||||
_fileSystemPathIdFixture = new FileSystemPathIdFixture();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void Constructor_WhenCalled_ShouldSetPropertiesCorrectly()
|
||||
{
|
||||
@@ -172,5 +167,4 @@ public class FileSystemItemTests
|
||||
FileSystemItemType type = _fixture.Create<FileSystemItemType>();
|
||||
return new FileSystemItemFixture(id, name, type);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-2
@@ -13,7 +13,6 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Fixtur
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class FileSystemItemFixture : FileSystemItem
|
||||
{
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FileSystemItemFixture"/> class.
|
||||
/// </summary>
|
||||
@@ -24,5 +23,4 @@ public class FileSystemItemFixture : FileSystemItem
|
||||
: base(id, name, fileSystemItemType)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -30,7 +30,6 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Servic
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class DirectoryProviderServiceTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly IFixture _fixture;
|
||||
private readonly IFileSystem _mockFileSystem;
|
||||
private readonly IFileSystemPermissionsService _mockFileSystemPermissionsService;
|
||||
@@ -59,9 +58,7 @@ public class DirectoryProviderServiceTests
|
||||
private readonly string _pathValid2 = s_isLinux ? "/Valid/" : @"C:\Valid\";
|
||||
private readonly string _pathInvalid2 = s_isLinux ? "/Invalid/" : @"C:\Invalid\";
|
||||
private readonly char _dirSeparator = s_isLinux ? '/' : '\\';
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DirectoryProviderServiceTests"/> class.
|
||||
/// </summary>
|
||||
@@ -73,9 +70,7 @@ public class DirectoryProviderServiceTests
|
||||
_sut = new DirectoryProviderService(_mockFileSystem, _mockFileSystemPermissionsService);
|
||||
_fileSystemPathIdFixture = new();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void GetSubdirectoryPaths_WhenUserHasNoAccess_ShouldReturnUnauthorizedAccessError()
|
||||
{
|
||||
@@ -1008,5 +1003,4 @@ public class DirectoryProviderServiceTests
|
||||
result.FirstError.Should().Be(Errors.Permission.UnauthorizedAccess);
|
||||
_mockFileSystem.DirectoryInfo.DidNotReceive().New(Arg.Any<string>());
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -28,7 +28,6 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Servic
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class DirectoryServiceTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly IEnvironmentContext _mockEnvironmentContext;
|
||||
private readonly IPlatformContextManager _mockPlatformContextManager;
|
||||
private readonly IPlatformContext _mockPlatformContext;
|
||||
@@ -40,9 +39,7 @@ public class DirectoryServiceTests
|
||||
private readonly string _pathDirTestSubDir1 = s_isLinux ? "/TestDir/Sub1" : @"C:\TestDir\Sub1";
|
||||
private readonly string _pathDirTestSubDir2 = s_isLinux ? "/TestDir/Sub2" : @"C:\TestDir\Sub2";
|
||||
private readonly char _dirSeparator = s_isLinux ? '/' : '\\';
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DirectoryServiceTests"/> class.
|
||||
/// </summary>
|
||||
@@ -56,9 +53,7 @@ public class DirectoryServiceTests
|
||||
_fileSystemPathIdFixture = new FileSystemPathIdFixture();
|
||||
_directoryFixture = new DirectoryFixture();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void GetSubdirectories_WithValidPath_ShouldReturnListOfDirectories()
|
||||
{
|
||||
@@ -786,5 +781,4 @@ public class DirectoryServiceTests
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.DirectoryNotFound);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -22,14 +22,11 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Servic
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class DriveServiceTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly IFileSystem _mockFileSystem;
|
||||
private readonly IPlatformContextManager _mockPlatformContextManager;
|
||||
private readonly IPlatformContext _mockPlatformContext;
|
||||
private readonly DriveService _sut;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DriveServiceTests"/> class.
|
||||
/// </summary>
|
||||
@@ -41,9 +38,7 @@ public class DriveServiceTests
|
||||
_mockPlatformContextManager.GetCurrentContext().Returns(_mockPlatformContext);
|
||||
_sut = new DriveService(_mockFileSystem, _mockPlatformContextManager);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void GetDrives_OnUnixPlatform_ShouldReturnSingleUnixRootItem()
|
||||
{
|
||||
@@ -90,5 +85,4 @@ public class DriveServiceTests
|
||||
mockDriveInfo.IsReady.Returns(isReady);
|
||||
return mockDriveInfo;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -29,7 +29,6 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Servic
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class FileProviderServiceTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly IFixture _fixture;
|
||||
private readonly IFileSystem _mockFileSystem;
|
||||
private readonly IFileSystemPermissionsService _mockFileSystemPermissionsService;
|
||||
@@ -46,9 +45,7 @@ public class FileProviderServiceTests
|
||||
private readonly string _pathSource = s_isLinux ? "/Source" : @"C:\Source";
|
||||
private readonly string _pathDestination = s_isLinux ? "/Destination" : @"C:\Destination";
|
||||
private readonly char _dirSeparator = s_isLinux ? '/' : '\\';
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FileProviderServiceTests"/> class.
|
||||
/// </summary>
|
||||
@@ -60,9 +57,7 @@ public class FileProviderServiceTests
|
||||
_sut = new FileProviderService(_mockFileSystem, _mockFileSystemPermissionsService);
|
||||
_fileSystemPathIdFixture = new();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void GetFilePaths_WhenUserHasNoAccess_ShouldReturnUnauthorizedAccessError()
|
||||
{
|
||||
@@ -931,5 +926,4 @@ public class FileProviderServiceTests
|
||||
result.FirstError.Should().Be(Errors.Permission.UnauthorizedAccess);
|
||||
_mockFileSystem.File.DidNotReceive().Delete(Arg.Any<string>());
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -28,7 +28,6 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Servic
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class FileServiceTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly IEnvironmentContext _mockEnvironmentContext;
|
||||
private readonly IPlatformContextManager _mockPlatformContextManager;
|
||||
private readonly IPlatformContext _mockPlatformContext;
|
||||
@@ -49,9 +48,7 @@ public class FileServiceTests
|
||||
private readonly string _pathSourceExistingFile = s_isLinux ? "/Source/existingfile.txt" : @"C:\Source\existingfile.txt";
|
||||
private readonly string _pathSourceNonExistingFile = s_isLinux ? "/Source/nonexistent.txt" : @"C:\Source\nonexistent.txt";
|
||||
private readonly char _dirSeparator = s_isLinux ? '/' : '\\';
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FileServiceTests"/> class.
|
||||
/// </summary>
|
||||
@@ -65,9 +62,7 @@ public class FileServiceTests
|
||||
_fileSystemPathIdFixture = new FileSystemPathIdFixture();
|
||||
_fileFixture = new FileFixture();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void GetFiles_WithValidPath_ShouldReturnListOfFiles()
|
||||
{
|
||||
@@ -1217,5 +1212,4 @@ public class FileServiceTests
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.Permission.UnauthorizedAccess);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -27,15 +27,12 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Servic
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class FileTypeServiceTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private MockFileSystem _mockFileSystem = null!;
|
||||
private readonly IFileSystemPermissionsService _mockFileSystemPermissionsService;
|
||||
private FileTypeService? sut;
|
||||
private readonly FileSystemPathIdFixture _fileSystemPathIdFixture;
|
||||
private readonly FileFixture _fileFixture;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FileTypeServiceTests"/> class.
|
||||
/// </summary>
|
||||
@@ -45,9 +42,7 @@ public class FileTypeServiceTests
|
||||
_fileSystemPathIdFixture = new FileSystemPathIdFixture();
|
||||
_fileFixture = new FileFixture();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public async Task GetImageTypeAsync_WithValidFile_ShouldReturnCorrectImageType()
|
||||
{
|
||||
@@ -233,5 +228,4 @@ public class FileTypeServiceTests
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Should().Be(expectedType, because: $"the file header matches {testName}");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-4
@@ -20,7 +20,6 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Servic
|
||||
public class ImageTypeFixture : TheoryData<ImageType, byte[]>
|
||||
{
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ImageTypeFixture"/> class.
|
||||
/// </summary>
|
||||
@@ -31,9 +30,7 @@ public class ImageTypeFixture : TheoryData<ImageType, byte[]>
|
||||
Add(ImageType.BMP, CreateImage(new BmpEncoder()));
|
||||
Add(ImageType.GIF, CreateImage(new GifEncoder()));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
/// <summary>
|
||||
/// Creates a byte array representing a thumbnail fixture.
|
||||
/// </summary>
|
||||
@@ -46,5 +43,4 @@ public class ImageTypeFixture : TheoryData<ImageType, byte[]>
|
||||
image.Save(ms, encoder);
|
||||
return ms.ToArray();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -21,16 +21,13 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Servic
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class PathServiceTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly IPlatformContextManager _mockPlatformContextManager;
|
||||
private readonly IPlatformContext _mockPlatformContext;
|
||||
private readonly IPathStrategy _mockPathStrategy;
|
||||
private readonly PathService _sut;
|
||||
private readonly FileSystemPathIdFixture _fileSystemPathIdFixture;
|
||||
private readonly PathSegmentFixture _pathSegmentFixture;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PathServiceTests"/> class.
|
||||
/// </summary>
|
||||
@@ -45,9 +42,7 @@ public class PathServiceTests
|
||||
_fileSystemPathIdFixture = new FileSystemPathIdFixture();
|
||||
_pathSegmentFixture = new PathSegmentFixture();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void IsValidPath_WithValidPath_ShouldReturnTrue()
|
||||
{
|
||||
@@ -528,5 +523,4 @@ public class PathServiceTests
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
_mockPathStrategy.DidNotReceive().GetPathRoot(Arg.Any<FileSystemPathId>());
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -26,13 +26,10 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Servic
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ThumbnailServiceTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly IEnvironmentContext _mockEnvironmentContext;
|
||||
private readonly ThumbnailService _sut;
|
||||
private readonly FileSystemPathIdFixture _fileSystemPathIdFixture;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ThumbnailServiceTests"/> class.
|
||||
/// </summary>
|
||||
@@ -42,9 +39,7 @@ public class ThumbnailServiceTests
|
||||
_sut = new ThumbnailService(_mockEnvironmentContext);
|
||||
_fileSystemPathIdFixture = new FileSystemPathIdFixture();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public async Task GetThumbnailAsync_WithValidPath_ShouldReturnThumbnail()
|
||||
{
|
||||
@@ -191,5 +186,4 @@ public class ThumbnailServiceTests
|
||||
await Assert.ThrowsAsync<TaskCanceledException>(() =>
|
||||
_sut.GetThumbnailAsync(pathId, quality, cts.Token));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -14,13 +14,10 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Strate
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class EnvironmentContextTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly IDirectoryProviderService _mockDirectoryProviderService;
|
||||
private readonly IFileProviderService _mockFileProviderService;
|
||||
private readonly IFileTypeService _mockFileTypeService;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EnvironmentContextTests"/> class.
|
||||
/// </summary>
|
||||
@@ -30,9 +27,7 @@ public class EnvironmentContextTests
|
||||
_mockFileProviderService = Substitute.For<IFileProviderService>();
|
||||
_mockFileTypeService = Substitute.For<IFileTypeService>();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void Constructor_WhenCalledWithValidParameters_ShouldInitializeAllProperties()
|
||||
{
|
||||
@@ -95,5 +90,4 @@ public class EnvironmentContextTests
|
||||
// Assert
|
||||
result.Should().Be(_mockDirectoryProviderService);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -20,14 +20,11 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Strate
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class UnixPathStrategyTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly IFileSystem _mockFileSystem;
|
||||
private readonly UnixPathStrategy _sut;
|
||||
private readonly FileSystemPathIdFixture _fileSystemPathIdFixture;
|
||||
private readonly PathSegmentFixture _pathSegmentFixture;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UnixPathStrategyTests"/> class.
|
||||
/// </summary>
|
||||
@@ -38,9 +35,7 @@ public class UnixPathStrategyTests
|
||||
_fileSystemPathIdFixture = new FileSystemPathIdFixture();
|
||||
_pathSegmentFixture = new PathSegmentFixture();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Theory]
|
||||
[InlineData("/home/user")]
|
||||
[InlineData("/var/log/")]
|
||||
@@ -556,5 +551,4 @@ public class UnixPathStrategyTests
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -20,14 +20,11 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Strate
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class WindowsPathStrategyTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly IFileSystem _mockFileSystem;
|
||||
private readonly WindowsPathStrategy _sut;
|
||||
private readonly FileSystemPathIdFixture _fileSystemPathIdFixture;
|
||||
private readonly PathSegmentFixture _pathSegmentFixture;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WindowsPathStrategyTests"/> class.
|
||||
/// </summary>
|
||||
@@ -38,9 +35,7 @@ public class WindowsPathStrategyTests
|
||||
_fileSystemPathIdFixture = new FileSystemPathIdFixture();
|
||||
_pathSegmentFixture = new PathSegmentFixture();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Theory]
|
||||
[InlineData(@"C:\Users\User")]
|
||||
[InlineData(@"D:\Program Files\")]
|
||||
@@ -772,5 +767,4 @@ public class WindowsPathStrategyTests
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -17,12 +17,9 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Strate
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class PlatformContextFactoryTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
private readonly PlatformContextFactory _sut;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PlatformContextFactoryTests"/> class.
|
||||
/// </summary>
|
||||
@@ -37,9 +34,7 @@ public class PlatformContextFactoryTests
|
||||
_serviceProvider = services.BuildServiceProvider();
|
||||
_sut = new PlatformContextFactory(_serviceProvider);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void CreateStrategy_WhenWindowsServiceExists_ShouldReturnWindowsService()
|
||||
{
|
||||
@@ -68,5 +63,4 @@ public class PlatformContextFactoryTests
|
||||
// Act & Assert
|
||||
Assert.Throws<InvalidOperationException>(() => _sut.CreateStrategy<INonExistentPlatformContextFixture>());
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -16,12 +16,9 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Strate
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class PlatformContextManagerTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly IPlatformContextFactory _mockPlatformContextFactory;
|
||||
private PlatformContextManager? sut;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PlatformContextManagerTests"/> class.
|
||||
/// </summary>
|
||||
@@ -29,9 +26,7 @@ public class PlatformContextManagerTests
|
||||
{
|
||||
_mockPlatformContextFactory = Substitute.For<IPlatformContextFactory>();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void GetCurrentContext_WhenNoContextSet_ShouldSetDefaultContext()
|
||||
{
|
||||
@@ -155,5 +150,4 @@ public class PlatformContextManagerTests
|
||||
result.Should().Be(mockWindowsContext);
|
||||
_mockPlatformContextFactory.Received(1).CreateStrategy<IWindowsPlatformContext>();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-2
@@ -15,7 +15,6 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Strate
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class PlatformContextTests
|
||||
{
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void WindowsPlatformContext_Constructor_ShouldSetPropertiesCorrectly()
|
||||
{
|
||||
@@ -117,5 +116,4 @@ public class PlatformContextTests
|
||||
unixPlatformContext.GetType().GetProperty(nameof(UnixPlatformContext.Platform))!
|
||||
.SetMethod.Should().BeNull();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -15,11 +15,8 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueO
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class FileSystemPathIdTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly FileSystemPathIdFixture _fileSystemPathIdFixture;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FileSystemPathIdTests"/> class.
|
||||
/// </summary>
|
||||
@@ -27,9 +24,7 @@ public class FileSystemPathIdTests
|
||||
{
|
||||
_fileSystemPathIdFixture = new FileSystemPathIdFixture();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void Create_WithValidPath_ShouldReturnFileSystemPathId()
|
||||
{
|
||||
@@ -146,5 +141,4 @@ public class FileSystemPathIdTests
|
||||
// Assert
|
||||
result.Should().BeTrue();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -14,11 +14,8 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueO
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class FileSystemPathIdFixture
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly Faker _faker;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FileSystemPathIdFixture"/> class.
|
||||
/// </summary>
|
||||
@@ -26,9 +23,7 @@ public class FileSystemPathIdFixture
|
||||
{
|
||||
_faker = new Faker();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
/// <summary>
|
||||
/// Creates a random valid <see cref="FileSystemPathId"/>.
|
||||
/// </summary>
|
||||
@@ -44,5 +39,4 @@ public class FileSystemPathIdFixture
|
||||
throw new InvalidOperationException("Failed to create FileSystemPathId: " + string.Join(", ", fileSystemPathIdResult.Errors));
|
||||
return fileSystemPathIdResult.Value;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -16,11 +16,8 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueO
|
||||
[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
|
||||
}
|
||||
-6
@@ -17,11 +17,8 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueO
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class StreamInfoFixture
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly Faker _faker;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="StreamInfoFixture"/> class.
|
||||
/// </summary>
|
||||
@@ -29,9 +26,7 @@ public class StreamInfoFixture
|
||||
{
|
||||
_faker = new Faker();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
/// <summary>
|
||||
/// Creates a random valid <see cref="StreamInfo"/>.
|
||||
/// </summary>
|
||||
@@ -80,5 +75,4 @@ public class StreamInfoFixture
|
||||
{
|
||||
return Enumerable.Range(0, count).Select(_ => CreateStreamInfo()).ToList();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -15,11 +15,8 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueO
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ThumbnailFixture
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly Faker _faker;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ThumbnailFixture"/> class.
|
||||
/// </summary>
|
||||
@@ -27,9 +24,7 @@ public class ThumbnailFixture
|
||||
{
|
||||
_faker = new Faker();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
/// <summary>
|
||||
/// Creates a random valid <see cref="Thumbnail"/>.
|
||||
/// </summary>
|
||||
@@ -53,5 +48,4 @@ public class ThumbnailFixture
|
||||
{
|
||||
return Enumerable.Range(0, count).Select(_ => CreateThumbnail()).ToList();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -15,11 +15,8 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueO
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class PathSegmentTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly PathSegmentFixture _pathSegmentFixture;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PathSegmentTests"/> class.
|
||||
/// </summary>
|
||||
@@ -27,9 +24,7 @@ public class PathSegmentTests
|
||||
{
|
||||
_pathSegmentFixture = new PathSegmentFixture();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void Create_WithValidInput_ShouldReturnPathSegment()
|
||||
{
|
||||
@@ -147,5 +142,4 @@ public class PathSegmentTests
|
||||
// Assert
|
||||
result.Should().BeTrue();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -27,11 +27,8 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueO
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class StreamInfoTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly StreamInfoFixture _streamInfoFixture;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="StreamInfoTests"/> class.
|
||||
/// </summary>
|
||||
@@ -39,9 +36,7 @@ public class StreamInfoTests
|
||||
{
|
||||
_streamInfoFixture = new StreamInfoFixture();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void Create_WithValidInput_ShouldReturnStreamInfo()
|
||||
{
|
||||
@@ -182,5 +177,4 @@ public class StreamInfoTests
|
||||
// Assert
|
||||
hashCode1.Should().NotBe(hashCode2);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -17,11 +17,8 @@ namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueO
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ThumbnailTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly ThumbnailFixture _thumbnailFixture;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ThumbnailTests"/> class.
|
||||
/// </summary>
|
||||
@@ -29,9 +26,7 @@ public class ThumbnailTests
|
||||
{
|
||||
_thumbnailFixture = new ThumbnailFixture();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void Constructor_ShouldSetPropertiesCorrectly()
|
||||
{
|
||||
@@ -133,5 +128,4 @@ public class ThumbnailTests
|
||||
components[0].Should().Be(thumbnail.Type);
|
||||
components[1].Should().BeEquivalentTo(thumbnail.Bytes);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
Reference in new issue
Block a user