Replaces ErrorOr library with a custom implementation.

This commit is contained in:
BinaryAlley committed 2026-08-14 03:04:28 -07:00
1 parent 8fe90a4dde
commit 3b772d68ca
436 files changed
+4234 -3922

No files matched your search

@@ -1,12 +1,12 @@
#region ========================================================================= USING =====================================================================================
using AutoFixture;
using AutoFixture.AutoNSubstitute;
using ErrorOr;
using Lumina.Application.Common.Infrastructure.Validation;
using Lumina.Application.Core.FileSystemManagement.Paths.Commands.CombinePath;
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Commands.CombinePath.Fixtures;
using Lumina.Contracts.Responses.FileSystemManagement.Path;
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
using Lumina.Application.Common.Infrastructure.Validation;
using NSubstitute;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
@@ -46,13 +46,13 @@ public class CombinePathCommandHandlerTests
string combinedPath = System.IO.Path.Combine(combinePathCommand.OriginalPath!, combinePathCommand.NewPath!);
_mockPathService.CombinePath(combinePathCommand.OriginalPath!, combinePathCommand.NewPath!)
.Returns(ErrorOrFactory.From(combinedPath));
.Returns(Result.From(combinedPath));
// Act
ErrorOr<PathSegmentResponse> result = await _sut.HandleAsync(combinePathCommand, CancellationToken.None);
Result<PathSegmentResponse> result = await _sut.HandleAsync(combinePathCommand, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.IsType<PathSegmentResponse>(result.Value);
Assert.Equal(combinedPath, result.Value.Path);
_mockPathService.Received(1).CombinePath(combinePathCommand.OriginalPath!, combinePathCommand.NewPath!);
@@ -68,10 +68,10 @@ public class CombinePathCommandHandlerTests
.Returns(error);
// Act
ErrorOr<PathSegmentResponse> result = await _sut.HandleAsync(command, CancellationToken.None);
Result<PathSegmentResponse> result = await _sut.HandleAsync(command, CancellationToken.None);
// Assert
Assert.True(result.IsError);
Assert.True(result.IsFailure);
Assert.Equal(error, result.FirstError);
_mockPathService.Received(1).CombinePath(command.OriginalPath!, command.NewPath!);
}
@@ -82,13 +82,13 @@ public class CombinePathCommandHandlerTests
// Arrange
CombinePathCommand command = _fixture.Create<CombinePathCommand>();
_mockPathService.CombinePath(command.OriginalPath!, command.NewPath!)
.Returns(ErrorOrFactory.From(string.Empty));
.Returns(Result.From(string.Empty));
// Act
ErrorOr<PathSegmentResponse> result = await _sut.HandleAsync(command, CancellationToken.None);
Result<PathSegmentResponse> result = await _sut.HandleAsync(command, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.IsType<PathSegmentResponse>(result.Value);
Assert.Empty(result.Value.Path);
_mockPathService.Received(1).CombinePath(command.OriginalPath!, command.NewPath!);
@@ -1,9 +1,9 @@
#region ========================================================================= USING =====================================================================================
using ErrorOr;
using Lumina.Application.Core.FileSystemManagement.Paths.Commands.CombinePath;
using Lumina.Application.UnitTests.Common.Setup;
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Commands.CombinePath.Fixtures;
using Lumina.Domain.SharedKernel.Common.Errors;
using Lumina.Domain.Common.Errors;
using Lumina.Domain.Common.Primitives;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#endregion
@@ -1,14 +1,14 @@
#region ========================================================================= USING =====================================================================================
using AutoFixture;
using AutoFixture.AutoNSubstitute;
using ErrorOr;
using Lumina.Application.Common.Infrastructure.Validation;
using Lumina.Application.Core.FileSystemManagement.Paths.Commands.SplitPath;
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Commands.SplitPath.Fixtures;
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Fixtures;
using Lumina.Contracts.Responses.FileSystemManagement.Path;
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
using Lumina.Application.Common.Infrastructure.Validation;
using NSubstitute;
using System;
using System.Collections.Generic;
@@ -54,18 +54,18 @@ public class SplitPathCommandHandlerTests
IEnumerable<PathSegment> pathSegments = _pathSegmentFixture.CreateMany();
_mockPathService.ParsePath(splitPathCommand.Path!)
.Returns(ErrorOrFactory.From(pathSegments));
.Returns(Result.From(pathSegments));
// Act
ErrorOr<IEnumerable<PathSegmentResponse>> result = await _sut.HandleAsync(splitPathCommand, CancellationToken.None);
Result<IEnumerable<PathSegmentResponse>> result = await _sut.HandleAsync(splitPathCommand, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.IsAssignableFrom<IEnumerable<PathSegmentResponse>>(result.Value);
Assert.Equal(pathSegments.Count(), result.Value.Count());
List<PathSegmentResponse> resultList = result.Value.ToList();
List<PathSegment> segmentsList = pathSegments.ToList();
List<PathSegmentResponse> resultList = [.. result.Value];
List<PathSegment> segmentsList = [.. pathSegments];
for (int i = 0; i < resultList.Count; i++)
Assert.Equal(segmentsList[i].Name, resultList[i].Path);
@@ -82,10 +82,10 @@ public class SplitPathCommandHandlerTests
.Returns(error);
// Act
ErrorOr<IEnumerable<PathSegmentResponse>> result = await _sut.HandleAsync(command, CancellationToken.None);
Result<IEnumerable<PathSegmentResponse>> result = await _sut.HandleAsync(command, CancellationToken.None);
// Assert
Assert.True(result.IsError);
Assert.True(result.IsFailure);
Assert.Equal(error, result.FirstError);
_mockPathService.Received(1).ParsePath(command.Path!);
}
@@ -95,15 +95,15 @@ public class SplitPathCommandHandlerTests
{
// Arrange
SplitPathCommand command = _fixture.Create<SplitPathCommand>();
ErrorOr<IEnumerable<PathSegment>> emptyList = ErrorOrFactory.From(Enumerable.Empty<PathSegment>());
Result<IEnumerable<PathSegment>> emptyList = Result.From(Enumerable.Empty<PathSegment>());
_mockPathService.ParsePath(command.Path!)
.Returns(emptyList);
// Act
ErrorOr<IEnumerable<PathSegmentResponse>> result = await _sut.HandleAsync(command, CancellationToken.None);
Result<IEnumerable<PathSegmentResponse>> result = await _sut.HandleAsync(command, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.Empty(result.Value);
_mockPathService.Received(1).ParsePath(command.Path!);
}
@@ -1,9 +1,9 @@
#region ========================================================================= USING =====================================================================================
using ErrorOr;
using Lumina.Application.Core.FileSystemManagement.Paths.Commands.SplitPath;
using Lumina.Application.UnitTests.Common.Setup;
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Commands.SplitPath.Fixtures;
using Lumina.Domain.SharedKernel.Common.Errors;
using Lumina.Domain.Common.Errors;
using Lumina.Domain.Common.Primitives;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#endregion
@@ -1,6 +1,6 @@
#region ========================================================================= USING =====================================================================================
using Bogus;
using ErrorOr;
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
using System;
using System.Collections.Generic;
@@ -39,9 +39,9 @@ public class PathSegmentFixture
isDirectory ??= true;
isDrive ??= false;
ErrorOr<PathSegment> pathResult = PathSegment.Create(name, isDirectory.Value, isDrive.Value);
Result<PathSegment> pathResult = PathSegment.Create(name, isDirectory.Value, isDrive.Value);
if (pathResult.IsError)
if (pathResult.IsFailure)
throw new InvalidOperationException("Failed to create PathSegment: " + string.Join(", ", pathResult.Errors));
return pathResult.Value;
}
@@ -1,10 +1,10 @@
#region ========================================================================= USING =====================================================================================
using ErrorOr;
using Lumina.Application.Common.Infrastructure.Validation;
using Lumina.Application.Core.FileSystemManagement.Paths.Queries.CheckPathExists;
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Queries.CheckPathExists.Fixtures;
using Lumina.Contracts.Responses.FileSystemManagement.Path;
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
using Lumina.Application.Common.Infrastructure.Validation;
using NSubstitute;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
@@ -42,10 +42,10 @@ public class CheckPathExistsQueryHandlerTests
_mockPathService.Exists(query.Path!).Returns(true);
// Act
ErrorOr<PathExistsResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
Result<PathExistsResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.True(result.Value.Exists);
_mockPathService.Received(1).Exists(query.Path!);
}
@@ -58,10 +58,10 @@ public class CheckPathExistsQueryHandlerTests
_mockPathService.Exists(query.Path!).Returns(true);
// Act
ErrorOr<PathExistsResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
Result<PathExistsResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.True(result.Value.Exists);
_mockPathService.Received(1).Exists(query.Path!);
}
@@ -74,10 +74,10 @@ public class CheckPathExistsQueryHandlerTests
_mockPathService.Exists(query.Path!, false).Returns(false);
// Act
ErrorOr<PathExistsResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
Result<PathExistsResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.False(result.Value.Exists);
_mockPathService.Received(1).Exists(query.Path!, false);
}
@@ -90,10 +90,10 @@ public class CheckPathExistsQueryHandlerTests
_mockPathService.Exists(query.Path!).Returns(false);
// Act
ErrorOr<PathExistsResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
Result<PathExistsResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.False(result.Value.Exists);
_mockPathService.Received(1).Exists(query.Path!);
}
@@ -106,10 +106,10 @@ public class CheckPathExistsQueryHandlerTests
_mockPathService.Exists(Arg.Any<string>(), Arg.Any<bool>()).Returns(false);
// Act
ErrorOr<PathExistsResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
Result<PathExistsResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.False(result.Value.Exists);
_mockPathService.Received(1).Exists(Arg.Any<string>(), Arg.Any<bool>());
}
@@ -123,10 +123,10 @@ public class CheckPathExistsQueryHandlerTests
CancellationToken cancellationToken = new(true);
// Act
ErrorOr<PathExistsResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
Result<PathExistsResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.True(result.Value.Exists);
_mockPathService.Received(1).Exists(query.Path!);
}
@@ -1,9 +1,9 @@
#region ========================================================================= USING =====================================================================================
using ErrorOr;
using Lumina.Application.Core.FileSystemManagement.Paths.Queries.CheckPathExists;
using Lumina.Application.UnitTests.Common.Setup;
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Queries.CheckPathExists.Fixtures;
using Lumina.Domain.SharedKernel.Common.Errors;
using Lumina.Domain.Common.Errors;
using Lumina.Domain.Common.Primitives;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#endregion
@@ -1,14 +1,14 @@
#region ========================================================================= USING =====================================================================================
using AutoFixture;
using AutoFixture.AutoNSubstitute;
using ErrorOr;
using Lumina.Application.Common.Infrastructure.Validation;
using Lumina.Application.Core.FileSystemManagement.Paths.Queries.GetPathParent;
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Fixtures;
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Queries.GetPathParent.Fixtures;
using Lumina.Contracts.Responses.FileSystemManagement.Path;
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
using Lumina.Application.Common.Infrastructure.Validation;
using NSubstitute;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
@@ -53,13 +53,13 @@ public class GetPathParentQueryHandlerTests
IEnumerable<PathSegmentResponse> pathSegmentResponses = pathSegments.Select(segment => new PathSegmentResponse(segment.Name));
_mockPathService.GoUpOneLevel(query.Path!)
.Returns(ErrorOrFactory.From(pathSegments));
.Returns(Result.From(pathSegments));
// Act
ErrorOr<IEnumerable<PathSegmentResponse>> result = await _sut.HandleAsync(query, CancellationToken.None);
Result<IEnumerable<PathSegmentResponse>> result = await _sut.HandleAsync(query, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.IsAssignableFrom<IEnumerable<PathSegmentResponse>>(result.Value);
Assert.Equal(pathSegmentResponses, result.Value);
_mockPathService.Received(1).GoUpOneLevel(query.Path!);
@@ -75,10 +75,10 @@ public class GetPathParentQueryHandlerTests
.Returns(error);
// Act
ErrorOr<IEnumerable<PathSegmentResponse>> result = await _sut.HandleAsync(query, CancellationToken.None);
Result<IEnumerable<PathSegmentResponse>> result = await _sut.HandleAsync(query, CancellationToken.None);
// Assert
Assert.True(result.IsError);
Assert.True(result.IsFailure);
Assert.Equal(error, result.FirstError);
_mockPathService.Received(1).GoUpOneLevel(query.Path!);
}
@@ -88,15 +88,15 @@ public class GetPathParentQueryHandlerTests
{
// Arrange
GetPathParentQuery query = _fixture.Create<GetPathParentQuery>();
ErrorOr<IEnumerable<PathSegment>> emptyList = ErrorOrFactory.From(Enumerable.Empty<PathSegment>());
Result<IEnumerable<PathSegment>> emptyList = Result.From(Enumerable.Empty<PathSegment>());
_mockPathService.GoUpOneLevel(query.Path!)
.Returns(emptyList);
// Act
ErrorOr<IEnumerable<PathSegmentResponse>> result = await _sut.HandleAsync(query, CancellationToken.None);
Result<IEnumerable<PathSegmentResponse>> result = await _sut.HandleAsync(query, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.Empty(result.Value);
_mockPathService.Received(1).GoUpOneLevel(query.Path!);
}
@@ -1,9 +1,9 @@
#region ========================================================================= USING =====================================================================================
using ErrorOr;
using Lumina.Application.Core.FileSystemManagement.Paths.Queries.GetPathParent;
using Lumina.Application.UnitTests.Common.Setup;
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Queries.GetPathParent.Fixtures;
using Lumina.Domain.SharedKernel.Common.Errors;
using Lumina.Domain.Common.Errors;
using Lumina.Domain.Common.Primitives;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#endregion
@@ -1,12 +1,12 @@
#region ========================================================================= USING =====================================================================================
using ErrorOr;
using Lumina.Application.Common.Infrastructure.Validation;
using Lumina.Application.Core.FileSystemManagement.Paths.Queries.GetPathRoot;
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Fixtures;
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Queries.GetPathRoot.Fixtures;
using Lumina.Contracts.Responses.FileSystemManagement.Path;
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
using Lumina.Application.Common.Infrastructure.Validation;
using NSubstitute;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
@@ -46,13 +46,13 @@ public class GetPathRootQueryHandlerTests
PathSegment pathSegment = _pathSegmentFixture.CreatePathSegment(isDrive: true);
_mockPathService.GetPathRoot(query.Path!)
.Returns(ErrorOrFactory.From(pathSegment));
.Returns(Result.From(pathSegment));
// Act
ErrorOr<PathSegmentResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
Result<PathSegmentResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.NotNull(result.Value);
Assert.Equal(pathSegment.Name, result.Value.Path);
_mockPathService.Received(1).GetPathRoot(query.Path!);
@@ -68,10 +68,10 @@ public class GetPathRootQueryHandlerTests
.Returns(error);
// Act
ErrorOr<PathSegmentResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
Result<PathSegmentResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
// Assert
Assert.True(result.IsError);
Assert.True(result.IsFailure);
Assert.Equal(error, result.FirstError);
_mockPathService.Received(1).GetPathRoot(query.Path!);
}
@@ -84,13 +84,13 @@ public class GetPathRootQueryHandlerTests
PathSegment rootPathSegment = _pathSegmentFixture.CreatePathSegment(name: "/", isDirectory: true, isDrive: true);
_mockPathService.GetPathRoot(query.Path!)
.Returns(ErrorOrFactory.From(rootPathSegment));
.Returns(Result.From(rootPathSegment));
// Act
ErrorOr<PathSegmentResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
Result<PathSegmentResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.NotNull(result.Value);
Assert.Equal("/", result.Value.Path);
_mockPathService.Received(1).GetPathRoot(query.Path!);
@@ -1,9 +1,9 @@
#region ========================================================================= USING =====================================================================================
using ErrorOr;
using Lumina.Application.Core.FileSystemManagement.Paths.Queries.GetPathRoot;
using Lumina.Application.UnitTests.Common.Setup;
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Queries.GetPathRoot.Fixtures;
using Lumina.Domain.SharedKernel.Common.Errors;
using Lumina.Domain.Common.Errors;
using Lumina.Domain.Common.Primitives;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#endregion
@@ -1,13 +1,12 @@
#region ========================================================================= USING =====================================================================================
using ErrorOr;
using Lumina.Application.Common.Infrastructure.Validation;
using Lumina.Application.Core.FileSystemManagement.Paths.Queries.ValidatePath;
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Queries.ValidatePath.Fixtures;
using Lumina.Contracts.Responses.FileSystemManagement.Path;
using Lumina.Domain.Common.Errors;
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
using Lumina.Domain.SharedKernel.Common.Errors;
using NSubstitute;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
@@ -45,10 +44,10 @@ public class ValidatePathQueryHandlerTests
_mockPathService.IsValidPath(query.Path!).Returns(true);
// Act
ErrorOr<PathValidResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
Result<PathValidResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.True(result.Value.IsValid);
_mockPathService.Received(1).IsValidPath(query.Path!);
}
@@ -61,10 +60,10 @@ public class ValidatePathQueryHandlerTests
_mockPathService.IsValidPath(query.Path!).Returns(false);
// Act
ErrorOr<PathValidResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
Result<PathValidResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.False(result.Value.IsValid);
_mockPathService.Received(1).IsValidPath(query.Path!);
}
@@ -77,10 +76,10 @@ public class ValidatePathQueryHandlerTests
_mockPathService.IsValidPath(Arg.Any<string>()).Returns(false);
// Act
ErrorOr<PathValidResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
Result<PathValidResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.False(result.Value.IsValid);
_mockPathService.Received(1).IsValidPath(Arg.Any<string>());
}
@@ -93,10 +92,10 @@ public class ValidatePathQueryHandlerTests
_mockPathService.IsValidPath(Arg.Any<string>()).Returns(false);
// Act
ErrorOr<PathValidResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
Result<PathValidResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
// Assert
Assert.False(result.IsError);
Assert.False(result.IsFailure);
Assert.False(result.Value.IsValid);
_mockPathService.Received(1).IsValidPath(Arg.Any<string>());
}
@@ -110,10 +109,10 @@ public class ValidatePathQueryHandlerTests
.Returns([Errors.FileSystemManagement.PathCannotBeEmpty]);
// Act
ErrorOr<PathValidResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
Result<PathValidResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
// Assert
Assert.True(result.IsError);
Assert.True(result.IsFailure);
Assert.Equal(Errors.FileSystemManagement.PathCannotBeEmpty, result.FirstError);
_mockPathService.DidNotReceive().IsValidPath(Arg.Any<string>());
}
@@ -1,9 +1,9 @@
#region ========================================================================= USING =====================================================================================
using ErrorOr;
using Lumina.Application.Core.FileSystemManagement.Paths.Queries.ValidatePath;
using Lumina.Application.UnitTests.Common.Setup;
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Queries.ValidatePath.Fixtures;
using Lumina.Domain.SharedKernel.Common.Errors;
using Lumina.Domain.Common.Errors;
using Lumina.Domain.Common.Primitives;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#endregion