mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 13:11:10 +00:00
Replaces ErrorOr library with a custom implementation.
This commit is contained in:
1 parent
8fe90a4dde
commit
3b772d68ca
436 files changed
+4234
-3922
No files matched your search
+6
-6
@@ -1,10 +1,10 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using Lumina.Application.Common.Mapping.FileSystemManagement.Common;
|
||||
using Lumina.Application.UnitTests.Core.FileSystemManagement.Directories.Fixtures;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.FileSystem;
|
||||
using Lumina.Contracts.Responses.FileSystemManagement.Common;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Entities;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.FileSystem;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
@@ -33,10 +33,10 @@ public class FileSystemTreeNodeResponseMappingTests
|
||||
FileSystemTreeNodeResponse response = _fileSystemTreeNodeResponseFixture.Create();
|
||||
|
||||
// Act
|
||||
ErrorOr<WindowsRootItem> result = response.ToWindowsRootItem();
|
||||
Result<WindowsRootItem> result = response.ToWindowsRootItem();
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsError);
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.NotNull(result.Value);
|
||||
Assert.Equal(response.Path, result.Value.Id.Path);
|
||||
Assert.Equal(response.Name, result.Value.Name);
|
||||
@@ -50,10 +50,10 @@ public class FileSystemTreeNodeResponseMappingTests
|
||||
FileSystemTreeNodeResponse response = _fileSystemTreeNodeResponseFixture.Create();
|
||||
|
||||
// Act
|
||||
ErrorOr<UnixRootItem> result = response.ToUnixRootItem();
|
||||
Result<UnixRootItem> result = response.ToUnixRootItem();
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsError);
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.NotNull(result.Value);
|
||||
Assert.Equal(FileSystemItemStatus.Accessible, result.Value.Status);
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using Lumina.Application.Common.Mapping.FileSystemManagement.FileSystem;
|
||||
using Lumina.Contracts.Responses.FileSystemManagement.Common;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.FileSystem;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Entities;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.FileSystem;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
@@ -19,8 +19,8 @@ public class UnixRootItemMappingTests
|
||||
public void ToTreeNodeResponse_WhenMappingUnixRootItem_ShouldMapCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
ErrorOr<UnixRootItem> createResult = UnixRootItem.Create();
|
||||
Assert.False(createResult.IsError);
|
||||
Result<UnixRootItem> createResult = UnixRootItem.Create();
|
||||
Assert.False(createResult.IsFailure);
|
||||
UnixRootItem domainModel = createResult.Value;
|
||||
|
||||
// Act
|
||||
|
||||
+6
-6
@@ -1,9 +1,9 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using Lumina.Application.Common.Mapping.FileSystemManagement.FileSystem;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.FileSystem;
|
||||
using Lumina.Contracts.Responses.FileSystemManagement.Common;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Entities;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.FileSystem;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
@@ -21,8 +21,8 @@ public class WindowsRootItemMappingTests
|
||||
// Arrange
|
||||
string path = "C:\\";
|
||||
string name = "C:";
|
||||
ErrorOr<WindowsRootItem> createResult = WindowsRootItem.Create(path, name);
|
||||
Assert.False(createResult.IsError);
|
||||
Result<WindowsRootItem> createResult = WindowsRootItem.Create(path, name);
|
||||
Assert.False(createResult.IsFailure);
|
||||
WindowsRootItem domainModel = createResult.Value;
|
||||
|
||||
// Act
|
||||
@@ -45,8 +45,8 @@ public class WindowsRootItemMappingTests
|
||||
string path = "D:\\";
|
||||
string name = "D:";
|
||||
FileSystemItemStatus customStatus = FileSystemItemStatus.Inaccessible;
|
||||
ErrorOr<WindowsRootItem> createResult = WindowsRootItem.Create(path, name, customStatus);
|
||||
Assert.False(createResult.IsError);
|
||||
Result<WindowsRootItem> createResult = WindowsRootItem.Create(path, name, customStatus);
|
||||
Assert.False(createResult.IsFailure);
|
||||
WindowsRootItem domainModel = createResult.Value;
|
||||
|
||||
// Act
|
||||
|
||||
+6
-6
@@ -1,7 +1,7 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using Lumina.Application.Common.Mapping.FileSystemManagement.Paths;
|
||||
using Lumina.Contracts.Responses.FileSystemManagement.Path;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
@@ -20,8 +20,8 @@ public class PathSegmentMappingTests
|
||||
public void ToResponse_WhenMappingPathSegment_ShouldMapCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
ErrorOr<PathSegment> createResult = PathSegment.Create("TestSegment", true, false);
|
||||
Assert.False(createResult.IsError);
|
||||
Result<PathSegment> createResult = PathSegment.Create("TestSegment", true, false);
|
||||
Assert.False(createResult.IsFailure);
|
||||
PathSegment pathSegment = createResult.Value;
|
||||
|
||||
// Act
|
||||
@@ -39,8 +39,8 @@ public class PathSegmentMappingTests
|
||||
public void ToResponse_WhenMappingDifferentPathSegmentTypes_ShouldMapCorrectly(string name, bool isDirectory, bool isDrive)
|
||||
{
|
||||
// Arrange
|
||||
ErrorOr<PathSegment> createResult = PathSegment.Create(name, isDirectory, isDrive);
|
||||
Assert.False(createResult.IsError);
|
||||
Result<PathSegment> createResult = PathSegment.Create(name, isDirectory, isDrive);
|
||||
Assert.False(createResult.IsFailure);
|
||||
PathSegment pathSegment = createResult.Value;
|
||||
|
||||
// Act
|
||||
@@ -69,7 +69,7 @@ public class PathSegmentMappingTests
|
||||
// Assert
|
||||
Assert.NotNull(results);
|
||||
Assert.Equal(pathSegments.Count, results.Count());
|
||||
List<PathSegmentResponse> resultList = results.ToList();
|
||||
List<PathSegmentResponse> resultList = [.. results];
|
||||
for (int i = 0; i < pathSegments.Count; i++)
|
||||
Assert.Equal(pathSegments[i].Name, resultList[i].Path);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user