mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 03:11:10 +00:00
Updates to .NET 9.0
This commit is contained in:
commit
acbdb0a5f8
853 files changed
+34993
-10123
No files matched your search
-31
@@ -1,31 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using ErrorOr;
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Entities;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entities.Fixtures;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="UnixRootItem"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class UnixRootItemFixture
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a random valid <see cref="UnixRootItem"/>.
|
||||
/// </summary>
|
||||
/// <param name="status">The status of the UNIX root item.</param>
|
||||
/// <returns>The created <see cref="UnixRootItem"/>.</returns>
|
||||
public UnixRootItem CreateUnixRootItem(FileSystemItemStatus status = FileSystemItemStatus.Accessible)
|
||||
{
|
||||
ErrorOr<UnixRootItem> unixRootItemResult = UnixRootItem.Create(status);
|
||||
|
||||
if (unixRootItemResult.IsError)
|
||||
throw new InvalidOperationException("Failed to create UnixRootItem: " + string.Join(", ", unixRootItemResult.Errors));
|
||||
return unixRootItemResult.Value;
|
||||
}
|
||||
}
|
||||
+8
-8
@@ -1,18 +1,18 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Entities;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Entities;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Fixtures;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Fixtures;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entities;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="Directory"/> class.
|
||||
@@ -55,7 +55,7 @@ public class DirectoryTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
+6
-6
@@ -1,16 +1,16 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Entities;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Entities;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entities;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="File"/> class.
|
||||
@@ -56,7 +56,7 @@ public class FileTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -150,7 +150,7 @@ public class FileTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.NameCannotBeEmpty);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.NameCannotBeEmpty);
|
||||
file.Name.Should().Be("file.txt");
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -1,17 +1,17 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using ErrorOr;
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Entities;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entities.Fixtures;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Entities.Fixtures;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="Directory"/> class.
|
||||
+3
-3
@@ -1,16 +1,16 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using ErrorOr;
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Entities;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entities.Fixtures;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Entities.Fixtures;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="File"/> class.
|
||||
+6
-6
@@ -1,15 +1,15 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Entities;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Entities;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entities;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="UnixRootItem"/> class.
|
||||
@@ -92,13 +92,13 @@ public class UnixRootItemTests
|
||||
ErrorOr<UnixRootItem> createResult = UnixRootItem.Create();
|
||||
createResult.IsError.Should().BeFalse();
|
||||
UnixRootItem unixRootItem = createResult.Value;
|
||||
|
||||
|
||||
// Act
|
||||
ErrorOr<Updated> result = unixRootItem.SetParent(null!);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.ParentNodeCannotBeNull);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.ParentNodeCannotBeNull);
|
||||
unixRootItem.Parent.HasValue.Should().BeFalse();
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -1,16 +1,16 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Entities;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Entities;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entities;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="WindowsRootItem"/> class.
|
||||
@@ -50,7 +50,7 @@ public class WindowsRootItemTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -140,7 +140,7 @@ public class WindowsRootItemTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.ParentNodeCannotBeNull);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.ParentNodeCannotBeNull);
|
||||
windowsRootItem.Parent.HasValue.Should().BeFalse();
|
||||
}
|
||||
}
|
||||
+7
-8
@@ -3,18 +3,17 @@ using AutoFixture;
|
||||
using AutoFixture.AutoNSubstitute;
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Fixtures;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Fixtures;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="FileSystemItem"/> class.
|
||||
@@ -96,7 +95,7 @@ public class FileSystemItemTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.ParentNodeCannotBeNull);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.ParentNodeCannotBeNull);
|
||||
item.Parent.Should().Be(Optional<FileSystemItem>.None());
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.Common.Enums.FileSystem;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Fixtures;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Fixtures;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="FileSystemItem"/> class.
|
||||
+77
-78
@@ -3,12 +3,12 @@ using AutoFixture;
|
||||
using AutoFixture.AutoNSubstitute;
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
using NSubstitute;
|
||||
using NSubstitute.ExceptionExtensions;
|
||||
using System;
|
||||
@@ -18,11 +18,9 @@ using System.IO;
|
||||
using System.IO.Abstractions;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Services;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="DirectoryProviderService"/> class.
|
||||
@@ -35,29 +33,29 @@ public class DirectoryProviderServiceTests
|
||||
private readonly IFileSystemPermissionsService _mockFileSystemPermissionsService;
|
||||
private readonly DirectoryProviderService _sut;
|
||||
private readonly FileSystemPathIdFixture _fileSystemPathIdFixture;
|
||||
private static readonly bool s_isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
|
||||
private readonly string _pathSource = s_isLinux ? "/Source" : @"C:\Source";
|
||||
private readonly string _pathSourceSubDir = s_isLinux ? "/Source/SubDir" : @"C:\Source\SubDir";
|
||||
private readonly string _pathSourceSubDir1 = s_isLinux ? "/Source/SubDir1" : @"C:\Source\SubDir1";
|
||||
private readonly string _pathSourceSubDir2 = s_isLinux ? "/Source/SubDir2" : @"C:\Source\SubDir2";
|
||||
private readonly string _pathSourceFile1 = s_isLinux ? "/Source/file1.txt" : @"C:\Source\file1.txt";
|
||||
private readonly string _pathSourceFile2 = s_isLinux ? "/Source/file2.txt" : @"C:\Source\file2.txt";
|
||||
private readonly string _pathDestinationFile1 = s_isLinux ? "/Destination/file1.txt" : @"C:\Destination\file1.txt";
|
||||
private readonly string _pathDestinationFile2 = s_isLinux ? "/Destination/file2.txt" : @"C:\Destination\file2.txt";
|
||||
private readonly string _pathDestination = s_isLinux ? "/Destination" : @"C:\Destination";
|
||||
private readonly string _pathDestinationSubDir = s_isLinux ? "/Destination/SubDir" : @"C:\Destination\SubDir";
|
||||
private readonly string _pathDestinationSubDir1 = s_isLinux ? "/Destination/SubDir1" : @"C:\Destination\SubDir1";
|
||||
private readonly string _pathDestinationSubDir2 = s_isLinux ? "/Destination/SubDir2" : @"C:\Destination\SubDir2";
|
||||
private readonly string _pathDestinationFile = s_isLinux ? "/Destination/file.txt" : @"C:\Destination\file.txt";
|
||||
private readonly string _pathVisible1 = s_isLinux ? "/Visible" : @"C:\Visible";
|
||||
private readonly string _pathHidden1 = s_isLinux ? "/Hidden" : @"C:\Hidden";
|
||||
private readonly string _pathVisible2 = s_isLinux ? "/Visible/" : @"C:\Visible\";
|
||||
private readonly string _pathHidden2 = s_isLinux ? "/Hidden/" : @"C:\Hidden\";
|
||||
private readonly string _pathValid1 = s_isLinux ? "/Valid" : @"C:\Valid";
|
||||
private readonly string _pathInvalid1 = s_isLinux ? "/Invalid" : @"C:\Invalid";
|
||||
private readonly string _pathValid2 = s_isLinux ? "/Valid/" : @"C:\Valid\";
|
||||
private readonly string _pathInvalid2 = s_isLinux ? "/Invalid/" : @"C:\Invalid\";
|
||||
private readonly char _dirSeparator = s_isLinux ? '/' : '\\';
|
||||
private static readonly bool s_isUnix = RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
|
||||
private readonly string _pathSource = s_isUnix ? "/Source" : @"C:\Source";
|
||||
private readonly string _pathSourceSubDir = s_isUnix ? "/Source/SubDir" : @"C:\Source\SubDir";
|
||||
private readonly string _pathSourceSubDir1 = s_isUnix ? "/Source/SubDir1" : @"C:\Source\SubDir1";
|
||||
private readonly string _pathSourceSubDir2 = s_isUnix ? "/Source/SubDir2" : @"C:\Source\SubDir2";
|
||||
private readonly string _pathSourceFile1 = s_isUnix ? "/Source/file1.txt" : @"C:\Source\file1.txt";
|
||||
private readonly string _pathSourceFile2 = s_isUnix ? "/Source/file2.txt" : @"C:\Source\file2.txt";
|
||||
private readonly string _pathDestinationFile1 = s_isUnix ? "/Destination/file1.txt" : @"C:\Destination\file1.txt";
|
||||
private readonly string _pathDestinationFile2 = s_isUnix ? "/Destination/file2.txt" : @"C:\Destination\file2.txt";
|
||||
private readonly string _pathDestination = s_isUnix ? "/Destination" : @"C:\Destination";
|
||||
private readonly string _pathDestinationSubDir = s_isUnix ? "/Destination/SubDir" : @"C:\Destination\SubDir";
|
||||
private readonly string _pathDestinationSubDir1 = s_isUnix ? "/Destination/SubDir1" : @"C:\Destination\SubDir1";
|
||||
private readonly string _pathDestinationSubDir2 = s_isUnix ? "/Destination/SubDir2" : @"C:\Destination\SubDir2";
|
||||
private readonly string _pathDestinationFile = s_isUnix ? "/Destination/file.txt" : @"C:\Destination\file.txt";
|
||||
private readonly string _pathVisible1 = s_isUnix ? "/Visible" : @"C:\Visible";
|
||||
private readonly string _pathHidden1 = s_isUnix ? "/Hidden" : @"C:\Hidden";
|
||||
private readonly string _pathVisible2 = s_isUnix ? "/Visible/" : @"C:\Visible\";
|
||||
private readonly string _pathHidden2 = s_isUnix ? "/Hidden/" : @"C:\Hidden\";
|
||||
private readonly string _pathValid1 = s_isUnix ? "/Valid" : @"C:\Valid";
|
||||
private readonly string _pathInvalid1 = s_isUnix ? "/Invalid" : @"C:\Invalid";
|
||||
private readonly string _pathValid2 = s_isUnix ? "/Valid/" : @"C:\Valid\";
|
||||
private readonly string _pathInvalid2 = s_isUnix ? "/Invalid/" : @"C:\Invalid\";
|
||||
private readonly char _dirSeparator = s_isUnix ? '/' : '\\';
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DirectoryProviderServiceTests"/> class.
|
||||
@@ -174,16 +172,16 @@ public class DirectoryProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId();
|
||||
string[] subdirectories = s_isLinux
|
||||
? new[] { "/C", "/A", "/B" }
|
||||
: new[] { @"C:\C", @"C:\A", @"C:\B" };
|
||||
string[] subdirectories = s_isUnix
|
||||
? ["/C", "/A", "/B"]
|
||||
: [@"C:\C", @"C:\A", @"C:\B"];
|
||||
_mockFileSystemPermissionsService.CanAccessPath(path, FileAccessMode.ListDirectory, false).Returns(true);
|
||||
_mockFileSystem.Directory.GetDirectories(path.Path).Returns(subdirectories);
|
||||
_mockFileSystem.Path.DirectorySeparatorChar.Returns(_dirSeparator);
|
||||
_mockFileSystem.File.GetAttributes(Arg.Any<string>()).Returns(FileAttributes.Directory);
|
||||
string[] expectedPaths = s_isLinux
|
||||
? new[] { "/A/", "/B/", "/C/" }
|
||||
: new[] { @"C:\A\", @"C:\B\", @"C:\C\" };
|
||||
string[] expectedPaths = s_isUnix
|
||||
? ["/A/", "/B/", "/C/"]
|
||||
: [@"C:\A\", @"C:\B\", @"C:\C\"];
|
||||
|
||||
// Act
|
||||
ErrorOr<IEnumerable<FileSystemPathId>> result = _sut.GetSubdirectoryPaths(path, false);
|
||||
@@ -243,8 +241,8 @@ public class DirectoryProviderServiceTests
|
||||
public void GetFileName_WhenPathIsValid_ShouldReturnFileName()
|
||||
{
|
||||
// Arrange
|
||||
string fullPath = s_isLinux
|
||||
? "/folder/subfolder/file.txt"
|
||||
string fullPath = s_isUnix
|
||||
? "/folder/subfolder/file.txt"
|
||||
: @"C:\folder\subfolder\file.txt";
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(fullPath);
|
||||
_mockFileSystem.Path.GetFileName(fullPath).Returns("file.txt");
|
||||
@@ -261,8 +259,8 @@ public class DirectoryProviderServiceTests
|
||||
public void GetFileName_WhenPathEndsWithDirectorySeparator_ShouldReturnLastSegment()
|
||||
{
|
||||
// Arrange
|
||||
string fullPath = s_isLinux
|
||||
? "/folder/subfolder/"
|
||||
string fullPath = s_isUnix
|
||||
? "/folder/subfolder/"
|
||||
: @"C:\folder\subfolder\";
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(fullPath);
|
||||
_mockFileSystem.Path.GetFileName(fullPath[..^1]).Returns("subfolder");
|
||||
@@ -280,8 +278,8 @@ public class DirectoryProviderServiceTests
|
||||
public void GetFileName_WhenPathIsRoot_ShouldReturnEmptyString()
|
||||
{
|
||||
// Arrange
|
||||
string fullPath = s_isLinux
|
||||
? "/C/"
|
||||
string fullPath = s_isUnix
|
||||
? "/C/"
|
||||
: @"/";
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(fullPath);
|
||||
_mockFileSystem.Path.GetFileName(fullPath[..^1]).Returns(string.Empty);
|
||||
@@ -367,8 +365,8 @@ public class DirectoryProviderServiceTests
|
||||
// Arrange
|
||||
FileSystemPathId parentPath = _fileSystemPathIdFixture.CreateFileSystemPathId(@"C:\Parent");
|
||||
string directoryName = "NewDirectory";
|
||||
string fullPath = s_isLinux
|
||||
? "/Parent/NewDirectory"
|
||||
string fullPath = s_isUnix
|
||||
? "/Parent/NewDirectory"
|
||||
: @"C:\Parent\NewDirectory";
|
||||
|
||||
_mockFileSystemPermissionsService.CanAccessPath(parentPath, FileAccessMode.Write, false).Returns(true);
|
||||
@@ -484,7 +482,7 @@ public class DirectoryProviderServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.DirectoryNotFound);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.DirectoryNotFound);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -493,8 +491,8 @@ public class DirectoryProviderServiceTests
|
||||
// Arrange
|
||||
FileSystemPathId sourcePath = _fileSystemPathIdFixture.CreateFileSystemPathId(_pathSource);
|
||||
FileSystemPathId destinationPath = _fileSystemPathIdFixture.CreateFileSystemPathId(_pathDestination);
|
||||
string expectedNewDirectoryPath = s_isLinux
|
||||
? "/Destination - Copy (1)"
|
||||
string expectedNewDirectoryPath = s_isUnix
|
||||
? "/Destination - Copy (1)"
|
||||
: @"C:\Destination - Copy (1)";
|
||||
bool overrideExisting = false;
|
||||
|
||||
@@ -528,13 +526,14 @@ public class DirectoryProviderServiceTests
|
||||
FileSystemPathId sourcePath = _fileSystemPathIdFixture.CreateFileSystemPathId(_pathSource);
|
||||
FileSystemPathId destinationPath = _fileSystemPathIdFixture.CreateFileSystemPathId(_pathDestination);
|
||||
bool overrideExisting = true;
|
||||
|
||||
|
||||
|
||||
|
||||
// ensure all relevant directories exist
|
||||
_mockFileSystem.Directory.Exists(_pathSource).Returns(true);
|
||||
_mockFileSystem.Directory.Exists(_pathSourceSubDir).Returns(true);
|
||||
_mockFileSystem.Directory.Exists(_pathDestination).Returns(false);
|
||||
_mockFileSystem.Directory.CreateDirectory(Arg.Any<string>()).Returns(callInfo => {
|
||||
_mockFileSystem.Directory.CreateDirectory(Arg.Any<string>()).Returns(callInfo =>
|
||||
{
|
||||
IDirectoryInfo mockDirInfo = Substitute.For<IDirectoryInfo>();
|
||||
mockDirInfo.FullName.Returns(callInfo.Arg<string>());
|
||||
return mockDirInfo;
|
||||
@@ -591,7 +590,7 @@ public class DirectoryProviderServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.DirectoryCopyError);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.DirectoryCopyError);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -599,7 +598,7 @@ public class DirectoryProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId sourcePath = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/NonExistentSource" : @"C:\NonExistentSource"
|
||||
s_isUnix ? "/NonExistentSource" : @"C:\NonExistentSource"
|
||||
);
|
||||
FileSystemPathId destinationPath = _fileSystemPathIdFixture.CreateFileSystemPathId(_pathDestination);
|
||||
bool overrideExisting = false;
|
||||
@@ -611,7 +610,7 @@ public class DirectoryProviderServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.DirectoryNotFound);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.DirectoryNotFound);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -667,8 +666,8 @@ public class DirectoryProviderServiceTests
|
||||
result.Value.Path.Should().Be(destinationPath.Path);
|
||||
_mockFileSystem.File.Received(1).Move(_pathSourceFile1, _pathDestinationFile1);
|
||||
_mockFileSystem.Directory.Received(1).Move(
|
||||
_pathSourceSubDir,
|
||||
s_isLinux ? "/Destination/SubDir" : @"C:\Destination\SubDir"
|
||||
_pathSourceSubDir,
|
||||
s_isUnix ? "/Destination/SubDir" : @"C:\Destination\SubDir"
|
||||
);
|
||||
_mockFileSystem.Directory.Received(1).Delete(sourcePath.Path);
|
||||
}
|
||||
@@ -691,7 +690,7 @@ public class DirectoryProviderServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.DirectoryMoveError);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.DirectoryMoveError);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -807,20 +806,20 @@ public class DirectoryProviderServiceTests
|
||||
_mockFileSystem.Directory.Exists(destPath.Path).Returns(true);
|
||||
|
||||
_mockFileSystem.Directory.Exists(_pathSourceSubDir).Returns(true);
|
||||
_mockFileSystem.Directory.Exists(s_isLinux ? "/Destination/SubDir" : @"C:\Destination\SubDir").Returns(true);
|
||||
_mockFileSystem.Directory.Exists(s_isUnix ? "/Destination/SubDir" : @"C:\Destination\SubDir").Returns(true);
|
||||
|
||||
_mockFileSystem.Directory.GetFiles(sourcePath.Path).Returns([]);
|
||||
_mockFileSystem.Directory.GetDirectories(sourcePath.Path).Returns([_pathSourceSubDir]);
|
||||
|
||||
_mockFileSystem.Directory.GetFiles(_pathSourceSubDir).Returns(
|
||||
s_isLinux ? ["/Source/SubDir/file.txt"] : [@"C:\Source\SubDir\file.txt"]
|
||||
s_isUnix ? ["/Source/SubDir/file.txt"] : [@"C:\Source\SubDir\file.txt"]
|
||||
);
|
||||
_mockFileSystem.Directory.GetDirectories(_pathSourceSubDir).Returns([]);
|
||||
|
||||
_mockFileSystem.Path.GetFileName(_pathSourceSubDir).Returns("SubDir");
|
||||
_mockFileSystem.Path.GetFileName(s_isLinux ? "/Source/SubDir/file.txt" : @"C:\Source\SubDir\file.txt").Returns("file.txt");
|
||||
_mockFileSystem.Path.GetFileName(s_isUnix ? "/Source/SubDir/file.txt" : @"C:\Source\SubDir\file.txt").Returns("file.txt");
|
||||
|
||||
_mockFileSystem.File.Exists(s_isLinux ? "/Destination/SubDir/file.txt" : @"C:\Destination\SubDir\file.txt").Returns(false);
|
||||
_mockFileSystem.File.Exists(s_isUnix ? "/Destination/SubDir/file.txt" : @"C:\Destination\SubDir\file.txt").Returns(false);
|
||||
|
||||
_mockFileSystem.Path.Combine(Arg.Any<string>(), Arg.Any<string>())
|
||||
.Returns(callInfo => Path.Combine(callInfo.ArgAt<string>(0), callInfo.ArgAt<string>(1)));
|
||||
@@ -835,8 +834,8 @@ public class DirectoryProviderServiceTests
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Should().Be(destPath);
|
||||
_mockFileSystem.File.Received(1).Move(
|
||||
s_isLinux ? "/Source/SubDir/file.txt" : @"C:\Source\SubDir\file.txt",
|
||||
s_isLinux ? "/Destination/SubDir/file.txt" : @"C:\Destination\SubDir\file.txt"
|
||||
s_isUnix ? "/Source/SubDir/file.txt" : @"C:\Source\SubDir\file.txt",
|
||||
s_isUnix ? "/Destination/SubDir/file.txt" : @"C:\Destination\SubDir\file.txt"
|
||||
);
|
||||
_mockFileSystem.Directory.Received(1).Delete(_pathSourceSubDir);
|
||||
_mockFileSystem.Directory.DidNotReceive().Delete(sourcePath.Path);
|
||||
@@ -847,11 +846,11 @@ public class DirectoryProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/OldName" : @"C:\OldName"
|
||||
s_isUnix ? "/OldName" : @"C:\OldName"
|
||||
);
|
||||
string newName = "NewName";
|
||||
string parentPath = s_isLinux ? "/" : @"C:\";
|
||||
string newPath = s_isLinux ? "/NewName" : @"C:\NewName";
|
||||
string parentPath = s_isUnix ? "/" : @"C:\";
|
||||
string newPath = s_isUnix ? "/NewName" : @"C:\NewName";
|
||||
|
||||
IDirectoryInfo parentDirectoryInfo = Substitute.For<IDirectoryInfo>();
|
||||
parentDirectoryInfo.FullName.Returns(parentPath);
|
||||
@@ -874,11 +873,11 @@ public class DirectoryProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/OldName" : @"C:\OldName"
|
||||
s_isUnix ? "/OldName" : @"C:\OldName"
|
||||
);
|
||||
string newName = "NewName";
|
||||
string parentPath = s_isLinux ? "/" : @"C:\";
|
||||
string newPath = s_isLinux ? "/NewName" : @"C:\NewName";
|
||||
string parentPath = s_isUnix ? "/" : @"C:\";
|
||||
string newPath = s_isUnix ? "/NewName" : @"C:\NewName";
|
||||
|
||||
IDirectoryInfo parentDirectoryInfo = Substitute.For<IDirectoryInfo>();
|
||||
parentDirectoryInfo.FullName.Returns(parentPath);
|
||||
@@ -900,11 +899,11 @@ public class DirectoryProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/OldName" : @"C:\OldName"
|
||||
s_isUnix ? "/OldName" : @"C:\OldName"
|
||||
);
|
||||
string newName = "NewName";
|
||||
string parentPath = s_isLinux ? "/" : @"C:\";
|
||||
string newPath = s_isLinux ? "/NewName" : @"C:\NewName";
|
||||
string parentPath = s_isUnix ? "/" : @"C:\";
|
||||
string newPath = s_isUnix ? "/NewName" : @"C:\NewName";
|
||||
|
||||
IDirectoryInfo parentDirectoryInfo = Substitute.For<IDirectoryInfo>();
|
||||
parentDirectoryInfo.FullName.Returns(parentPath);
|
||||
@@ -927,7 +926,7 @@ public class DirectoryProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/OldName" : @"C:\OldName"
|
||||
s_isUnix ? "/OldName" : @"C:\OldName"
|
||||
);
|
||||
string newName = "NewName";
|
||||
|
||||
@@ -938,7 +937,7 @@ public class DirectoryProviderServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
_mockFileSystem.Directory.DidNotReceive().Move(Arg.Any<string>(), Arg.Any<string>());
|
||||
}
|
||||
|
||||
@@ -947,10 +946,10 @@ public class DirectoryProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/OldName" : @"C:\OldName"
|
||||
s_isUnix ? "/OldName" : @"C:\OldName"
|
||||
);
|
||||
string newName = "NewName";
|
||||
string parentPath = s_isLinux ? "/" : @"C:\";
|
||||
string parentPath = s_isUnix ? "/" : @"C:\";
|
||||
|
||||
IDirectoryInfo parentDirectoryInfo = Substitute.For<IDirectoryInfo>();
|
||||
parentDirectoryInfo.FullName.Returns(parentPath);
|
||||
@@ -962,7 +961,7 @@ public class DirectoryProviderServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
_mockFileSystem.Directory.DidNotReceive().Move(Arg.Any<string>(), Arg.Any<string>());
|
||||
}
|
||||
|
||||
@@ -971,7 +970,7 @@ public class DirectoryProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/DirectoryToDelete" : @"C:\DirectoryToDelete"
|
||||
s_isUnix ? "/DirectoryToDelete" : @"C:\DirectoryToDelete"
|
||||
);
|
||||
_mockFileSystemPermissionsService.CanAccessPath(path, FileAccessMode.Delete, false).Returns(true);
|
||||
IDirectoryInfo mockDirectoryInfo = Substitute.For<IDirectoryInfo>();
|
||||
@@ -991,7 +990,7 @@ public class DirectoryProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/DirectoryToDelete" : @"C:\DirectoryToDelete"
|
||||
s_isUnix ? "/DirectoryToDelete" : @"C:\DirectoryToDelete"
|
||||
);
|
||||
_mockFileSystemPermissionsService.CanAccessPath(path, FileAccessMode.Delete, false).Returns(false);
|
||||
|
||||
+44
-45
@@ -1,16 +1,16 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Entities;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Environment;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Platform;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entities.Fixtures;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Environment;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Platform;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Entities;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Entities.Fixtures;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
using NSubstitute;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -20,7 +20,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Services;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="DirectoryService"/> class.
|
||||
@@ -34,11 +34,10 @@ public class DirectoryServiceTests
|
||||
private readonly DirectoryService _sut;
|
||||
private readonly FileSystemPathIdFixture _fileSystemPathIdFixture;
|
||||
private readonly DirectoryFixture _directoryFixture;
|
||||
private static readonly bool s_isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
|
||||
private readonly string _pathDirTest = s_isLinux ? "/TestDir" : @"C:\TestDir";
|
||||
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 ? '/' : '\\';
|
||||
private static readonly bool s_isUnix = RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
|
||||
private readonly string _pathDirTest = s_isUnix ? "/TestDir" : @"C:\TestDir";
|
||||
private readonly string _pathDirTestSubDir1 = s_isUnix ? "/TestDir/Sub1" : @"C:\TestDir\Sub1";
|
||||
private readonly string _pathDirTestSubDir2 = s_isUnix ? "/TestDir/Sub2" : @"C:\TestDir\Sub2";
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DirectoryServiceTests"/> class.
|
||||
@@ -101,7 +100,7 @@ public class DirectoryServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -131,7 +130,7 @@ public class DirectoryServiceTests
|
||||
bool includeHiddenElements = false;
|
||||
FileSystemPathId pathId = _fileSystemPathIdFixture.CreateFileSystemPathId(path);
|
||||
FileSystemPathId subPath = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/TestDir/InaccessibleSub" : @"C:\TestDir\InaccessibleSub"
|
||||
s_isUnix ? "/TestDir/InaccessibleSub" : @"C:\TestDir\InaccessibleSub"
|
||||
);
|
||||
|
||||
_mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(pathId, includeHiddenElements)
|
||||
@@ -212,7 +211,7 @@ public class DirectoryServiceTests
|
||||
Directory parentDirectory = _directoryFixture.CreateDirectory();
|
||||
bool includeHiddenElements = false;
|
||||
FileSystemPathId subPath = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/TestDir/InaccessibleSub" : @"C:\TestDir\InaccessibleSub"
|
||||
s_isUnix ? "/TestDir/InaccessibleSub" : @"C:\TestDir\InaccessibleSub"
|
||||
);
|
||||
|
||||
_mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(parentDirectory.Id, includeHiddenElements)
|
||||
@@ -293,7 +292,7 @@ public class DirectoryServiceTests
|
||||
FileSystemPathId pathId = _fileSystemPathIdFixture.CreateFileSystemPathId(_pathDirTest);
|
||||
bool includeHiddenElements = false;
|
||||
FileSystemPathId subPath = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/TestDir/InaccessibleSub" : @"C:\TestDir\InaccessibleSub"
|
||||
s_isUnix ? "/TestDir/InaccessibleSub" : @"C:\TestDir\InaccessibleSub"
|
||||
);
|
||||
|
||||
_mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(pathId, includeHiddenElements)
|
||||
@@ -353,7 +352,7 @@ public class DirectoryServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -464,7 +463,7 @@ public class DirectoryServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.DirectoryAlreadyExists);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.DirectoryAlreadyExists);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -475,14 +474,14 @@ public class DirectoryServiceTests
|
||||
string newDirName = "NewDirectory";
|
||||
|
||||
_mockPlatformContext.PathStrategy.CombinePath(parentPathId, newDirName)
|
||||
.Returns(Errors.FileManagement.InvalidPath);
|
||||
.Returns(Errors.FileSystemManagement.InvalidPath);
|
||||
|
||||
// Act
|
||||
ErrorOr<Directory> result = _sut.CreateDirectory(parentPathId, newDirName);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
|
||||
// Verify that DirectoryExists was not called
|
||||
_mockEnvironmentContext.DirectoryProviderService.DidNotReceive().DirectoryExists(Arg.Any<FileSystemPathId>());
|
||||
@@ -493,11 +492,11 @@ public class DirectoryServiceTests
|
||||
public void RenameDirectory_WithValidStringPath_ShouldReturnRenamedDirectory()
|
||||
{
|
||||
// Arrange
|
||||
string oldPath = s_isLinux ? "/TestDir/OldName" : @"C:\TestDir\OldName";
|
||||
string oldPath = s_isUnix ? "/TestDir/OldName" : @"C:\TestDir\OldName";
|
||||
string newName = "NewName";
|
||||
FileSystemPathId oldPathId = _fileSystemPathIdFixture.CreateFileSystemPathId(oldPath);
|
||||
FileSystemPathId newPathId = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/TestDir/NewName" : @"C:\TestDir\NewName"
|
||||
s_isUnix ? "/TestDir/NewName" : @"C:\TestDir\NewName"
|
||||
);
|
||||
|
||||
_mockEnvironmentContext.DirectoryProviderService.RenameDirectory(oldPathId, newName)
|
||||
@@ -530,7 +529,7 @@ public class DirectoryServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -538,11 +537,11 @@ public class DirectoryServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId oldPathId = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/TestDir/OldName" : @"C:\TestDir\OldName"
|
||||
s_isUnix ? "/TestDir/OldName" : @"C:\TestDir\OldName"
|
||||
);
|
||||
string newName = "NewName";
|
||||
FileSystemPathId newPathId = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/TestDir/NewName" : @"C:\TestDir\NewName"
|
||||
s_isUnix ? "/TestDir/NewName" : @"C:\TestDir\NewName"
|
||||
);
|
||||
|
||||
_mockEnvironmentContext.DirectoryProviderService.RenameDirectory(oldPathId, newName)
|
||||
@@ -568,7 +567,7 @@ public class DirectoryServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId oldPathId = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/TestDir/OldName" : @"C:\TestDir\OldName"
|
||||
s_isUnix ? "/TestDir/OldName" : @"C:\TestDir\OldName"
|
||||
);
|
||||
string newName = "NewName";
|
||||
|
||||
@@ -588,11 +587,11 @@ public class DirectoryServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId oldPathId = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/TestDir/OldName" : @"C:\TestDir\OldName"
|
||||
s_isUnix ? "/TestDir/OldName" : @"C:\TestDir\OldName"
|
||||
);
|
||||
string newName = "NewName";
|
||||
FileSystemPathId newPathId = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/TestDir/NewName" : @"C:\TestDir\NewName"
|
||||
s_isUnix ? "/TestDir/NewName" : @"C:\TestDir\NewName"
|
||||
);
|
||||
|
||||
_mockEnvironmentContext.DirectoryProviderService.RenameDirectory(oldPathId, newName)
|
||||
@@ -621,11 +620,11 @@ public class DirectoryServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId oldPathId = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/TestDir/OldName" : @"C:\TestDir\OldName"
|
||||
s_isUnix ? "/TestDir/OldName" : @"C:\TestDir\OldName"
|
||||
);
|
||||
string newName = "ExistingDirectory";
|
||||
FileSystemPathId newPathId = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/TestDir/ExistingDirectory" : @"C:\TestDir\ExistingDirectory"
|
||||
s_isUnix ? "/TestDir/ExistingDirectory" : @"C:\TestDir\ExistingDirectory"
|
||||
);
|
||||
|
||||
_mockPlatformContext.PathStrategy.CombinePath(Arg.Any<FileSystemPathId>(), newName)
|
||||
@@ -638,7 +637,7 @@ public class DirectoryServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.DirectoryAlreadyExists);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.DirectoryAlreadyExists);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -646,19 +645,19 @@ public class DirectoryServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId oldPathId = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/TestDir/OldName" : @"C:\TestDir\OldName"
|
||||
s_isUnix ? "/TestDir/OldName" : @"C:\TestDir\OldName"
|
||||
);
|
||||
string newName = "NewName";
|
||||
|
||||
_mockPlatformContext.PathStrategy.CombinePath(Arg.Any<FileSystemPathId>(), newName)
|
||||
.Returns(Errors.FileManagement.InvalidPath);
|
||||
.Returns(Errors.FileSystemManagement.InvalidPath);
|
||||
|
||||
// Act
|
||||
ErrorOr<Directory> result = _sut.RenameDirectory(oldPathId, newName);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
|
||||
// Verify that DirectoryExists and RenameDirectory were not called
|
||||
_mockEnvironmentContext.DirectoryProviderService.DidNotReceive().DirectoryExists(Arg.Any<FileSystemPathId>());
|
||||
@@ -670,11 +669,11 @@ public class DirectoryServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId oldPathId = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/TestDir/OldName" : @"C:\TestDir\OldName"
|
||||
s_isUnix ? "/TestDir/OldName" : @"C:\TestDir\OldName"
|
||||
);
|
||||
string newName = "NewName";
|
||||
FileSystemPathId newPathId = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/TestDir/NewName" : @"C:\TestDir\NewName"
|
||||
s_isUnix ? "/TestDir/NewName" : @"C:\TestDir\NewName"
|
||||
);
|
||||
_mockPlatformContext.PathStrategy.CombinePath(Arg.Any<FileSystemPathId>(), newName)
|
||||
.Returns(ErrorOrFactory.From(newPathId));
|
||||
@@ -697,7 +696,7 @@ public class DirectoryServiceTests
|
||||
public void DeleteDirectory_WithValidStringPath_ShouldReturnDeleted()
|
||||
{
|
||||
// Arrange
|
||||
string path = s_isLinux ? "/TestDir/ToDelete" : @"C:\TestDir\ToDelete";
|
||||
string path = s_isUnix ? "/TestDir/ToDelete" : @"C:\TestDir\ToDelete";
|
||||
FileSystemPathId pathId = _fileSystemPathIdFixture.CreateFileSystemPathId(path);
|
||||
|
||||
_mockEnvironmentContext.DirectoryProviderService.DeleteDirectory(pathId)
|
||||
@@ -722,7 +721,7 @@ public class DirectoryServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -730,7 +729,7 @@ public class DirectoryServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId pathId = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/TestDir/ToDelete" : @"C:\TestDir\ToDelete"
|
||||
s_isUnix ? "/TestDir/ToDelete" : @"C:\TestDir\ToDelete"
|
||||
);
|
||||
|
||||
_mockEnvironmentContext.DirectoryProviderService.DeleteDirectory(pathId)
|
||||
@@ -749,7 +748,7 @@ public class DirectoryServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId pathId = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/TestDir/ToDelete" : @"C:\TestDir\ToDelete"
|
||||
s_isUnix ? "/TestDir/ToDelete" : @"C:\TestDir\ToDelete"
|
||||
);
|
||||
|
||||
_mockEnvironmentContext.DirectoryProviderService.DeleteDirectory(pathId)
|
||||
@@ -768,17 +767,17 @@ public class DirectoryServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId pathId = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/TestDir/NonExistent" : @"C:\TestDir\NonExistent"
|
||||
s_isUnix ? "/TestDir/NonExistent" : @"C:\TestDir\NonExistent"
|
||||
);
|
||||
|
||||
_mockEnvironmentContext.DirectoryProviderService.DeleteDirectory(pathId)
|
||||
.Returns(Errors.FileManagement.DirectoryNotFound);
|
||||
.Returns(Errors.FileSystemManagement.DirectoryNotFound);
|
||||
|
||||
// Act
|
||||
ErrorOr<Deleted> result = _sut.DeleteDirectory(pathId);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.DirectoryNotFound);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.DirectoryNotFound);
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,12 +1,11 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Entities;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Platform;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Fixtures;
|
||||
using Lumina.Domain.Common.Enums.FileSystem;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Entities;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Platform;
|
||||
using NSubstitute;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
@@ -14,7 +13,7 @@ using System.IO.Abstractions;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Services;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="DriveService"/> class.
|
||||
+45
-46
@@ -3,12 +3,12 @@ using AutoFixture;
|
||||
using AutoFixture.AutoNSubstitute;
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
using NSubstitute;
|
||||
using NSubstitute.ExceptionExtensions;
|
||||
using System;
|
||||
@@ -21,7 +21,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Services;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="FileProviderService"/> class.
|
||||
@@ -34,17 +34,15 @@ public class FileProviderServiceTests
|
||||
private readonly IFileSystemPermissionsService _mockFileSystemPermissionsService;
|
||||
private readonly FileProviderService _sut;
|
||||
private readonly FileSystemPathIdFixture _fileSystemPathIdFixture;
|
||||
private static readonly bool s_isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
|
||||
private readonly string _pathDirTest = s_isLinux ? "/TestDir" : @"C:\TestDir";
|
||||
private readonly string _pathVisible1 = s_isLinux ? "/Visible.txt" : @"C:\Visible.txt";
|
||||
private readonly string _pathHidden1 = s_isLinux ? "/Hidden.txt" : @"C:\Hidden.txt";
|
||||
private readonly string _pathValid1 = s_isLinux ? "/Valid.txt" : @"C:\Valid.txt";
|
||||
private readonly string _pathInvalid1 = s_isLinux ? "/Invalid.txt" : @"C:\Invalid.txt";
|
||||
private readonly string _pathSourceFile = s_isLinux ? "/Source/file.txt" : @"C:\Source\file.txt";
|
||||
private readonly string _pathDestinationFile = s_isLinux ? "/Destination/file.txt" : @"C:\Destination\file.txt";
|
||||
private readonly string _pathSource = s_isLinux ? "/Source" : @"C:\Source";
|
||||
private readonly string _pathDestination = s_isLinux ? "/Destination" : @"C:\Destination";
|
||||
private readonly char _dirSeparator = s_isLinux ? '/' : '\\';
|
||||
private static readonly bool s_isUnix = RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
|
||||
private readonly string _pathVisible1 = s_isUnix ? "/Visible.txt" : @"C:\Visible.txt";
|
||||
private readonly string _pathHidden1 = s_isUnix ? "/Hidden.txt" : @"C:\Hidden.txt";
|
||||
private readonly string _pathValid1 = s_isUnix ? "/Valid.txt" : @"C:\Valid.txt";
|
||||
private readonly string _pathInvalid1 = s_isUnix ? "/Invalid.txt" : @"C:\Invalid.txt";
|
||||
private readonly string _pathSourceFile = s_isUnix ? "/Source/file.txt" : @"C:\Source\file.txt";
|
||||
private readonly string _pathDestinationFile = s_isUnix ? "/Destination/file.txt" : @"C:\Destination\file.txt";
|
||||
private readonly string _pathSource = s_isUnix ? "/Source" : @"C:\Source";
|
||||
private readonly string _pathDestination = s_isUnix ? "/Destination" : @"C:\Destination";
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FileProviderServiceTests"/> class.
|
||||
@@ -156,10 +154,10 @@ public class FileProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId();
|
||||
string[] files = s_isLinux
|
||||
string[] files = s_isUnix
|
||||
? ["/C.txt", "/A.txt", "/B.txt"]
|
||||
: [@"C:\C.txt", @"C:\A.txt", @"C:\B.txt"];
|
||||
string[] expectedFiles = s_isLinux
|
||||
string[] expectedFiles = s_isUnix
|
||||
? ["/A.txt", "/B.txt", "/C.txt"]
|
||||
: [@"C:\A.txt", @"C:\B.txt", @"C:\C.txt"];
|
||||
_mockFileSystemPermissionsService.CanAccessPath(path, FileAccessMode.ListDirectory).Returns(true);
|
||||
@@ -506,7 +504,7 @@ public class FileProviderServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.FileNotFound);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.FileNotFound);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -532,7 +530,7 @@ public class FileProviderServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.FileAlreadyExists);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.FileAlreadyExists);
|
||||
_mockFileSystem.File.DidNotReceive().Copy(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<bool>());
|
||||
}
|
||||
|
||||
@@ -576,7 +574,7 @@ public class FileProviderServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.FileCopyError);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.FileCopyError);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -604,7 +602,8 @@ public class FileProviderServiceTests
|
||||
// Simulate the behavior of CreateUniqueFilePath
|
||||
int copyNumber = 1;
|
||||
_mockFileSystem.File.Exists(Arg.Any<string>())
|
||||
.Returns(x => {
|
||||
.Returns(x =>
|
||||
{
|
||||
string path = x.Arg<string>();
|
||||
if (path == expectedNewFilePath)
|
||||
return false;
|
||||
@@ -626,7 +625,7 @@ public class FileProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId sourcePath = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/NonExistentSource.txt" : @"C:\NonExistentSource.txt"
|
||||
s_isUnix ? "/NonExistentSource.txt" : @"C:\NonExistentSource.txt"
|
||||
);
|
||||
FileSystemPathId destinationPath = _fileSystemPathIdFixture.CreateFileSystemPathId(_pathDestination);
|
||||
bool overrideExisting = false;
|
||||
@@ -638,7 +637,7 @@ public class FileProviderServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.FileNotFound);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.FileNotFound);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -706,7 +705,7 @@ public class FileProviderServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.FileAlreadyExists);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.FileAlreadyExists);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -730,7 +729,7 @@ public class FileProviderServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.FileMoveError);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.FileMoveError);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -738,11 +737,11 @@ public class FileProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/OldName.txt" : @"C:\OldName.txt"
|
||||
s_isUnix ? "/OldName.txt" : @"C:\OldName.txt"
|
||||
);
|
||||
string newName = "NewName.txt";
|
||||
string parentPath = s_isLinux ? "/" : @"C:\";
|
||||
string newPath = s_isLinux ? "/NewName.txt" : @"C:\NewName.txt";
|
||||
string parentPath = s_isUnix ? "/" : @"C:\";
|
||||
string newPath = s_isUnix ? "/NewName.txt" : @"C:\NewName.txt";
|
||||
|
||||
IFileInfo fileInfo = Substitute.For<IFileInfo>();
|
||||
fileInfo.DirectoryName.Returns(parentPath);
|
||||
@@ -765,11 +764,11 @@ public class FileProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/OldName.txt" : @"C:\OldName.txt"
|
||||
s_isUnix ? "/OldName.txt" : @"C:\OldName.txt"
|
||||
);
|
||||
string newName = "NewName.txt";
|
||||
string parentPath = s_isLinux ? "/" : @"C:\";
|
||||
string newPath = s_isLinux ? "/NewName.txt" : @"C:\NewName.txt";
|
||||
string parentPath = s_isUnix ? "/" : @"C:\";
|
||||
string newPath = s_isUnix ? "/NewName.txt" : @"C:\NewName.txt";
|
||||
|
||||
IFileInfo fileInfo = Substitute.For<IFileInfo>();
|
||||
fileInfo.DirectoryName.Returns(parentPath);
|
||||
@@ -791,11 +790,11 @@ public class FileProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/OldName.txt" : @"C:\OldName.txt"
|
||||
s_isUnix ? "/OldName.txt" : @"C:\OldName.txt"
|
||||
);
|
||||
string newName = "NewName.txt";
|
||||
string parentPath = s_isLinux ? "/" : @"C:\";
|
||||
string newPath = s_isLinux ? "/NewName.txt" : @"C:\NewName.txt";
|
||||
string parentPath = s_isUnix ? "/" : @"C:\";
|
||||
string newPath = s_isUnix ? "/NewName.txt" : @"C:\NewName.txt";
|
||||
|
||||
IFileInfo fileInfo = Substitute.For<IFileInfo>();
|
||||
fileInfo.DirectoryName.Returns(parentPath);
|
||||
@@ -818,7 +817,7 @@ public class FileProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/OldName.txt" : @"C:\OldName.txt"
|
||||
s_isUnix ? "/OldName.txt" : @"C:\OldName.txt"
|
||||
);
|
||||
string newName = "NewName.txt";
|
||||
|
||||
@@ -829,7 +828,7 @@ public class FileProviderServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.CannotNavigateUp);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.CannotNavigateUp);
|
||||
_mockFileSystem.File.DidNotReceive().Move(Arg.Any<string>(), Arg.Any<string>());
|
||||
}
|
||||
|
||||
@@ -838,10 +837,10 @@ public class FileProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/OldName.txt" : @"C:\OldName.txt"
|
||||
s_isUnix ? "/OldName.txt" : @"C:\OldName.txt"
|
||||
);
|
||||
string newName = "NewName.txt";
|
||||
string parentPath = s_isLinux ? "/" : @"C:\";
|
||||
string parentPath = s_isUnix ? "/" : @"C:\";
|
||||
|
||||
IFileInfo fileInfo = Substitute.For<IFileInfo>();
|
||||
fileInfo.DirectoryName.Returns(parentPath);
|
||||
@@ -853,7 +852,7 @@ public class FileProviderServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
_mockFileSystem.File.DidNotReceive().Move(Arg.Any<string>(), Arg.Any<string>());
|
||||
}
|
||||
|
||||
@@ -862,12 +861,12 @@ public class FileProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/OldName.txt" : @"C:\OldName.txt"
|
||||
s_isUnix ? "/OldName.txt" : @"C:\OldName.txt"
|
||||
);
|
||||
string newName = "NewName.txt";
|
||||
string parentPath = s_isLinux ? "/" : @"C:\";
|
||||
string newPath = s_isLinux ? "/NewName.txt" : @"C:\NewName.txt";
|
||||
|
||||
string parentPath = s_isUnix ? "/" : @"C:\";
|
||||
string newPath = s_isUnix ? "/NewName.txt" : @"C:\NewName.txt";
|
||||
|
||||
IFileInfo fileInfo = Substitute.For<IFileInfo>();
|
||||
fileInfo.DirectoryName.Returns(parentPath);
|
||||
_mockFileSystem.FileInfo.New(path.Path).Returns(fileInfo);
|
||||
@@ -895,7 +894,7 @@ public class FileProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/FileToDelete.txt" : @"C:\FileToDelete.txt"
|
||||
s_isUnix ? "/FileToDelete.txt" : @"C:\FileToDelete.txt"
|
||||
);
|
||||
_mockFileSystemPermissionsService.CanAccessPath(path, FileAccessMode.Delete).Returns(true);
|
||||
_mockFileSystem.File.Exists(path.Path).Returns(true);
|
||||
@@ -914,7 +913,7 @@ public class FileProviderServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/FileToDelete.txt" : @"C:\FileToDelete.txt"
|
||||
s_isUnix ? "/FileToDelete.txt" : @"C:\FileToDelete.txt"
|
||||
);
|
||||
_mockFileSystemPermissionsService.CanAccessPath(path, FileAccessMode.Delete).Returns(false);
|
||||
|
||||
+43
-43
@@ -1,16 +1,16 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Entities;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Environment;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Platform;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entities.Fixtures;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Entities;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Environment;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Platform;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Entities.Fixtures;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
using NSubstitute;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -20,7 +20,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Services;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="FileService"/> class.
|
||||
@@ -34,20 +34,20 @@ public class FileServiceTests
|
||||
private readonly FileService _sut;
|
||||
private readonly FileSystemPathIdFixture _fileSystemPathIdFixture;
|
||||
private readonly FileFixture _fileFixture;
|
||||
private static readonly bool s_isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
|
||||
private readonly string _pathTestDir= s_isLinux ? "/TestDir" : @"C:\TestDir";
|
||||
private readonly string _pathTestDirFile1 = s_isLinux ? "/TestDir/File1.txt" : @"C:\TestDir\File1.txt";
|
||||
private readonly string _pathTestDirFile2 = s_isLinux ? "/TestDir/File2.txt" : @"C:\TestDir\File2.txt";
|
||||
private readonly string _pathTestDirInaccessible = s_isLinux ? "/TestDir/InaccessibleFile.txt" : @"C:\TestDir\InaccessibleFile.txt";
|
||||
private readonly string _pathDestination1 = s_isLinux ? "/Destination/" : @"C:\Destination\";
|
||||
private readonly string _pathDestination2 = s_isLinux ? "/Destination" : @"C:\Destination";
|
||||
private readonly string _pathSourceFile = s_isLinux ? "/Source/file.txt" : @"C:\Source\file.txt";
|
||||
private readonly string _pathDestinationFile = s_isLinux ? "/Destination/file.txt" : @"C:\Destination\file.txt";
|
||||
private readonly string _pathSourceOldFile = s_isLinux ? "/Source/oldfile.txt" : @"C:\Source\oldfile.txt";
|
||||
private readonly string _pathSourceNewFile = s_isLinux ? "/Source/newfile.txt" : @"C:\Source\newfile.txt";
|
||||
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 ? '/' : '\\';
|
||||
private static readonly bool s_isUnix = RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
|
||||
private readonly string _pathTestDir = s_isUnix ? "/TestDir" : @"C:\TestDir";
|
||||
private readonly string _pathTestDirFile1 = s_isUnix ? "/TestDir/File1.txt" : @"C:\TestDir\File1.txt";
|
||||
private readonly string _pathTestDirFile2 = s_isUnix ? "/TestDir/File2.txt" : @"C:\TestDir\File2.txt";
|
||||
private readonly string _pathTestDirInaccessible = s_isUnix ? "/TestDir/InaccessibleFile.txt" : @"C:\TestDir\InaccessibleFile.txt";
|
||||
private readonly string _pathDestination1 = s_isUnix ? "/Destination/" : @"C:\Destination\";
|
||||
private readonly string _pathDestination2 = s_isUnix ? "/Destination" : @"C:\Destination";
|
||||
private readonly string _pathSourceFile = s_isUnix ? "/Source/file.txt" : @"C:\Source\file.txt";
|
||||
private readonly string _pathDestinationFile = s_isUnix ? "/Destination/file.txt" : @"C:\Destination\file.txt";
|
||||
private readonly string _pathSourceOldFile = s_isUnix ? "/Source/oldfile.txt" : @"C:\Source\oldfile.txt";
|
||||
private readonly string _pathSourceNewFile = s_isUnix ? "/Source/newfile.txt" : @"C:\Source\newfile.txt";
|
||||
private readonly string _pathSourceExistingFile = s_isUnix ? "/Source/existingfile.txt" : @"C:\Source\existingfile.txt";
|
||||
private readonly string _pathSourceNonExistingFile = s_isUnix ? "/Source/nonexistent.txt" : @"C:\Source\nonexistent.txt";
|
||||
private readonly char _dirSeparator = s_isUnix ? '/' : '\\';
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FileServiceTests"/> class.
|
||||
@@ -112,7 +112,7 @@ public class FileServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -380,7 +380,7 @@ public class FileServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.FileNotFound);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.FileNotFound);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -449,7 +449,7 @@ public class FileServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -460,13 +460,13 @@ public class FileServiceTests
|
||||
string invalidDestinationPath = string.Empty;
|
||||
bool overrideExisting = true;
|
||||
_mockPlatformContext.PathStrategy.PathSeparator.Returns(_dirSeparator);
|
||||
|
||||
|
||||
// Act
|
||||
ErrorOr<File> result = _sut.CopyFile(sourcePath, invalidDestinationPath, overrideExisting);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -513,7 +513,7 @@ public class FileServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.FileNotFound);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.FileNotFound);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -614,7 +614,7 @@ public class FileServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.FileNotFound);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.FileNotFound);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -687,7 +687,7 @@ public class FileServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -705,7 +705,7 @@ public class FileServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -742,7 +742,7 @@ public class FileServiceTests
|
||||
{
|
||||
// Arrange
|
||||
FileSystemPathId sourcePathId = _fileSystemPathIdFixture.CreateFileSystemPathId(
|
||||
s_isLinux ? "/Source/nonexistent.txt" : _pathSourceNonExistingFile
|
||||
s_isUnix ? "/Source/nonexistent.txt" : _pathSourceNonExistingFile
|
||||
);
|
||||
FileSystemPathId destinationPathId = _fileSystemPathIdFixture.CreateFileSystemPathId(_pathDestination2);
|
||||
bool overrideExisting = true;
|
||||
@@ -754,7 +754,7 @@ public class FileServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.FileNotFound);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.FileNotFound);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -875,7 +875,7 @@ public class FileServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.FileAlreadyExists);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.FileAlreadyExists);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -946,7 +946,7 @@ public class FileServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -996,7 +996,7 @@ public class FileServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.FileAlreadyExists);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.FileAlreadyExists);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -1055,17 +1055,17 @@ public class FileServiceTests
|
||||
// Arrange
|
||||
string path = _pathSourceOldFile;
|
||||
string newName = "newfile.txt";
|
||||
|
||||
|
||||
_mockPlatformContext.PathStrategy.PathSeparator.Returns(_dirSeparator);
|
||||
_mockPlatformContext.PathStrategy.CombinePath(Arg.Any<FileSystemPathId>(), newName)
|
||||
.Returns(Errors.FileManagement.InvalidPath);
|
||||
.Returns(Errors.FileSystemManagement.InvalidPath);
|
||||
|
||||
// Act
|
||||
ErrorOr<File> result = _sut.RenameFile(path, newName);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -1098,14 +1098,14 @@ public class FileServiceTests
|
||||
string newName = "newfile.txt";
|
||||
|
||||
_mockPlatformContext.PathStrategy.CombinePath(Arg.Any<FileSystemPathId>(), newName)
|
||||
.Returns(Errors.FileManagement.InvalidPath);
|
||||
.Returns(Errors.FileSystemManagement.InvalidPath);
|
||||
|
||||
// Act
|
||||
ErrorOr<File> result = _sut.RenameFile(pathId, newName);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -1158,7 +1158,7 @@ public class FileServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
+8
-8
@@ -1,14 +1,14 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Contracts.Enums.PhotoLibrary;
|
||||
using Lumina.Domain.Common.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Enums.PhotoLibrary;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Entities;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entities.Fixtures;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Entities;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Entities.Fixtures;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
using NSubstitute;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
@@ -19,7 +19,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Services;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="FileTypeService"/> class.
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Contracts.Enums.PhotoLibrary;
|
||||
using Lumina.Domain.Common.Enums.PhotoLibrary;
|
||||
using SixLabors.ImageSharp;
|
||||
using SixLabors.ImageSharp.Formats;
|
||||
using SixLabors.ImageSharp.Formats.Bmp;
|
||||
@@ -11,7 +11,7 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Services.Fixtures;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services.Fixtures;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="ImageType"/> enum.
|
||||
+22
-22
@@ -2,18 +2,18 @@
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Path;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Platform;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Path;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Platform;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
using NSubstitute;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Services;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="PathService"/> class.
|
||||
@@ -226,7 +226,7 @@ public class PathServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
_mockPathStrategy.DidNotReceive().CombinePath(Arg.Any<FileSystemPathId>(), Arg.Any<string>());
|
||||
}
|
||||
|
||||
@@ -237,14 +237,14 @@ public class PathServiceTests
|
||||
string path = @"C:\BaseDir";
|
||||
string name = "Invalid*Name";
|
||||
FileSystemPathId pathId = _fileSystemPathIdFixture.CreateFileSystemPathId(path);
|
||||
_mockPathStrategy.CombinePath(pathId, name).Returns(Errors.FileManagement.InvalidPath);
|
||||
_mockPathStrategy.CombinePath(pathId, name).Returns(Errors.FileSystemManagement.InvalidPath);
|
||||
|
||||
// Act
|
||||
ErrorOr<string> result = _sut.CombinePath(path, name);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
_mockPathStrategy.Received(1).CombinePath(Arg.Is<FileSystemPathId>(id => id.Path == path), name);
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ public class PathServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
_mockPathStrategy.DidNotReceive().CombinePath(Arg.Any<FileSystemPathId>(), Arg.Any<string>());
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ public class PathServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
_mockPathStrategy.DidNotReceive().ParsePath(Arg.Any<FileSystemPathId>());
|
||||
}
|
||||
|
||||
@@ -303,14 +303,14 @@ public class PathServiceTests
|
||||
// Arrange
|
||||
string path = @"C:\InvalidPath\*SubDir";
|
||||
FileSystemPathId pathId = _fileSystemPathIdFixture.CreateFileSystemPathId(path);
|
||||
_mockPathStrategy.ParsePath(pathId).Returns(Errors.FileManagement.InvalidPath);
|
||||
_mockPathStrategy.ParsePath(pathId).Returns(Errors.FileSystemManagement.InvalidPath);
|
||||
|
||||
// Act
|
||||
ErrorOr<IEnumerable<PathSegment>> result = _sut.ParsePath(path);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
_mockPathStrategy.Received(1).ParsePath(Arg.Is<FileSystemPathId>(id => id.Path == path));
|
||||
}
|
||||
|
||||
@@ -325,7 +325,7 @@ public class PathServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
_mockPathStrategy.DidNotReceive().ParsePath(Arg.Any<FileSystemPathId>());
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ public class PathServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
_mockPathStrategy.DidNotReceive().GoUpOneLevel(Arg.Any<FileSystemPathId>());
|
||||
}
|
||||
|
||||
@@ -386,14 +386,14 @@ public class PathServiceTests
|
||||
// Arrange
|
||||
string path = @"C:\InvalidPath\*SubDir";
|
||||
FileSystemPathId pathId = _fileSystemPathIdFixture.CreateFileSystemPathId(path);
|
||||
_mockPathStrategy.GoUpOneLevel(pathId).Returns(Errors.FileManagement.InvalidPath);
|
||||
_mockPathStrategy.GoUpOneLevel(pathId).Returns(Errors.FileSystemManagement.InvalidPath);
|
||||
|
||||
// Act
|
||||
ErrorOr<IEnumerable<PathSegment>> result = _sut.GoUpOneLevel(path);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
_mockPathStrategy.Received(1).GoUpOneLevel(Arg.Is<FileSystemPathId>(id => id.Path == path));
|
||||
}
|
||||
|
||||
@@ -408,7 +408,7 @@ public class PathServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
_mockPathStrategy.DidNotReceive().GoUpOneLevel(Arg.Any<FileSystemPathId>());
|
||||
}
|
||||
|
||||
@@ -488,7 +488,7 @@ public class PathServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
_mockPathStrategy.DidNotReceive().GetPathRoot(Arg.Any<FileSystemPathId>());
|
||||
}
|
||||
|
||||
@@ -498,14 +498,14 @@ public class PathServiceTests
|
||||
// Arrange
|
||||
string path = @"C:\InvalidPath\*SubDir";
|
||||
FileSystemPathId pathId = _fileSystemPathIdFixture.CreateFileSystemPathId(path);
|
||||
_mockPathStrategy.GetPathRoot(pathId).Returns(Errors.FileManagement.InvalidPath);
|
||||
_mockPathStrategy.GetPathRoot(pathId).Returns(Errors.FileSystemManagement.InvalidPath);
|
||||
|
||||
// Act
|
||||
ErrorOr<PathSegment> result = _sut.GetPathRoot(path);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
_mockPathStrategy.Received(1).GetPathRoot(Arg.Is<FileSystemPathId>(id => id.Path == path));
|
||||
}
|
||||
|
||||
@@ -520,7 +520,7 @@ public class PathServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
_mockPathStrategy.DidNotReceive().GetPathRoot(Arg.Any<FileSystemPathId>());
|
||||
}
|
||||
}
|
||||
+8
-8
@@ -1,13 +1,13 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Contracts.Enums.PhotoLibrary;
|
||||
using Lumina.Domain.Common.Enums.PhotoLibrary;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Environment;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Services.Fixtures;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Environment;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services.Fixtures;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
using NSubstitute;
|
||||
using SixLabors.ImageSharp;
|
||||
using SixLabors.ImageSharp.Formats.Jpeg;
|
||||
@@ -18,7 +18,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Services;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="ThumbnailService"/> class.
|
||||
@@ -83,7 +83,7 @@ public class ThumbnailServiceTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FluentAssertions;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Environment;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Environment;
|
||||
using NSubstitute;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Strategies.Environment;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Strategies.Environment;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="EnvironmentContext"/> class.
|
||||
+11
-11
@@ -2,9 +2,9 @@
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Path;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Path;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
using NSubstitute;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
@@ -12,7 +12,7 @@ using System.IO.Abstractions;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Strategies.Path;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Strategies.Path;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="UnixPathStrategy"/> class.
|
||||
@@ -128,7 +128,7 @@ public class UnixPathStrategyTests
|
||||
// Arrange
|
||||
string existingPath = "/home/user/existing_file.txt";
|
||||
FileSystemPathId pathId = _fileSystemPathIdFixture.CreateFileSystemPathId(existingPath);
|
||||
|
||||
|
||||
_mockFileSystem.Path.Exists(existingPath).Returns(true);
|
||||
_mockFileSystem.File.Exists(existingPath).Returns(true);
|
||||
|
||||
@@ -283,7 +283,7 @@ public class UnixPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.NameCannotBeEmpty);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.NameCannotBeEmpty);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -298,7 +298,7 @@ public class UnixPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.NameCannotBeEmpty);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.NameCannotBeEmpty);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -376,7 +376,7 @@ public class UnixPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -422,7 +422,7 @@ public class UnixPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.CannotNavigateUp);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.CannotNavigateUp);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -452,7 +452,7 @@ public class UnixPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -549,6 +549,6 @@ public class UnixPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
}
|
||||
+17
-17
@@ -2,9 +2,9 @@
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Path;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Path;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
using NSubstitute;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
@@ -12,7 +12,7 @@ using System.IO.Abstractions;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Strategies.Path;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Strategies.Path;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="WindowsPathStrategy"/> class.
|
||||
@@ -326,7 +326,7 @@ public class WindowsPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.NameCannotBeEmpty);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.NameCannotBeEmpty);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -419,7 +419,7 @@ public class WindowsPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -484,7 +484,7 @@ public class WindowsPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.CannotNavigateUp);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.CannotNavigateUp);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -514,7 +514,7 @@ public class WindowsPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -561,7 +561,7 @@ public class WindowsPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.CannotNavigateUp);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.CannotNavigateUp);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -592,7 +592,7 @@ public class WindowsPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.CannotNavigateUp);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.CannotNavigateUp);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -602,7 +602,7 @@ public class WindowsPathStrategyTests
|
||||
char[] result = _sut.GetInvalidPathCharsForPlatform();
|
||||
|
||||
// Assert
|
||||
result.Should().BeEquivalentTo(['<', '>', '"', '/', '|', '?', '*' ]);
|
||||
result.Should().BeEquivalentTo(['<', '>', '"', '/', '|', '?', '*']);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -667,7 +667,7 @@ public class WindowsPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -695,7 +695,7 @@ public class WindowsPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -709,7 +709,7 @@ public class WindowsPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -723,7 +723,7 @@ public class WindowsPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -737,7 +737,7 @@ public class WindowsPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -765,6 +765,6 @@ public class WindowsPathStrategyTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Platform;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Platform;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Strategies.Platform.Fixtures;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Strategies.Platform.Fixtures;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture interface for non existing platform context.
|
||||
+4
-4
@@ -1,15 +1,15 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FluentAssertions;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Path;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Platform;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Strategies.Platform.Fixtures;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Path;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Platform;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Strategies.Platform.Fixtures;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO.Abstractions;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Strategies.Platform;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Strategies.Platform;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="PlatformContextFactory"/> class.
|
||||
+3
-3
@@ -1,14 +1,14 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FluentAssertions;
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Platform;
|
||||
using Lumina.Domain.Common.Enums.FileSystem;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Platform;
|
||||
using NSubstitute;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Strategies.Platform;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Strategies.Platform;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="PlatformContextManager"/> class.
|
||||
+4
-4
@@ -1,13 +1,13 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FluentAssertions;
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Path;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Platform;
|
||||
using Lumina.Domain.Common.Enums.FileSystem;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Path;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Platform;
|
||||
using NSubstitute;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Strategies.Platform;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Strategies.Platform;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="WindowsPlatformContext"/> and <see cref="UnixPlatformContext"/> classes.
|
||||
+6
-6
@@ -2,12 +2,12 @@
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="FileSystemPathId"/> class.
|
||||
@@ -43,14 +43,14 @@ public class FileSystemPathIdTests
|
||||
[InlineData(null)]
|
||||
[InlineData("")]
|
||||
[InlineData(" ")]
|
||||
public void Create_WithInvalidPath_ShouldReturnError(string invalidPath)
|
||||
public void Create_WithInvalidPath_ShouldReturnError(string? invalidPath)
|
||||
{
|
||||
// Act
|
||||
ErrorOr<FileSystemPathId> result = FileSystemPathId.Create(invalidPath);
|
||||
ErrorOr<FileSystemPathId> result = FileSystemPathId.Create(invalidPath!);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.InvalidPath);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.InvalidPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using ErrorOr;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="FileSystemPathId"/> class.
|
||||
+2
-2
@@ -1,14 +1,14 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using ErrorOr;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="PathSegment"/> class.
|
||||
+2
-2
@@ -2,14 +2,14 @@
|
||||
using Bogus;
|
||||
using ErrorOr;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="StreamInfo"/> class.
|
||||
+3
-3
@@ -1,13 +1,13 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using Lumina.Contracts.Enums.PhotoLibrary;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.Common.Enums.PhotoLibrary;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="Thumbnail"/> class.
|
||||
+6
-6
@@ -2,12 +2,12 @@
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="PathSegment"/> class.
|
||||
@@ -47,14 +47,14 @@ public class PathSegmentTests
|
||||
[InlineData(null)]
|
||||
[InlineData("")]
|
||||
[InlineData(" ")]
|
||||
public void Create_WithInvalidName_ShouldReturnError(string invalidName)
|
||||
public void Create_WithInvalidName_ShouldReturnError(string? invalidName)
|
||||
{
|
||||
// Act
|
||||
ErrorOr<PathSegment> result = PathSegment.Create(invalidName, true, false);
|
||||
ErrorOr<PathSegment> result = PathSegment.Create(invalidName!, true, false);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.NameCannotBeEmpty);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.NameCannotBeEmpty);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
+6
-16
@@ -1,25 +1,15 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Contracts.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Entities;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Environment;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Strategies.Platform;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.Entities.Fixtures;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
using NSubstitute;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="StreamInfo"/> class.
|
||||
@@ -79,7 +69,7 @@ public class StreamInfoTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.StreamIdCannotBeEmpty);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.StreamIdCannotBeEmpty);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -96,7 +86,7 @@ public class StreamInfoTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.CodecCannotBeEmpty);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.CodecCannotBeEmpty);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -113,7 +103,7 @@ public class StreamInfoTests
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.FileManagement.BitrateMustBeAPositiveNumber);
|
||||
result.FirstError.Should().Be(Errors.FileSystemManagement.BitrateMustBeAPositiveNumber);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
+4
-4
@@ -1,15 +1,15 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FluentAssertions;
|
||||
using Lumina.Contracts.Enums.PhotoLibrary;
|
||||
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects.Fixtures;
|
||||
using Lumina.Domain.Common.Enums.PhotoLibrary;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects.Fixtures;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileManagementAggregate.ValueObjects;
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="Thumbnail"/> class.
|
||||
@@ -9,21 +9,28 @@
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AssemblyAttribute Include="Xunit.CollectionBehaviorAttribute">
|
||||
<_Parameter1>DisableTestParallelization = true</_Parameter1>
|
||||
<_Parameter1_IsLiteral>true</_Parameter1_IsLiteral>
|
||||
</AssemblyAttribute>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoFixture.AutoNSubstitute" Version="5.0.0-preview0011" />
|
||||
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="21.0.29" />
|
||||
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="21.1.3" />
|
||||
<PackageReference Include="AutoFixture.Xunit2" Version="5.0.0-preview0011" />
|
||||
<PackageReference Include="Bogus" Version="35.6.0" />
|
||||
<PackageReference Include="Bogus" Version="35.6.1" />
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="FluentAssertions" Version="7.0.0-alpha.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0-rc.2.24473.5" />
|
||||
<PackageReference Include="FluentAssertions" Version="7.0.0-alpha.5" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
|
||||
<PackageReference Include="NSubstitute" Version="5.1.0" />
|
||||
<PackageReference Include="NSubstitute" Version="5.3.0" />
|
||||
<PackageReference Include="xunit" Version="2.9.2" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0-pre.35">
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0-pre.49">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
||||
Reference in new issue
Block a user