mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 13:11:10 +00:00
Removes FluentAssertions library from test projects, due to licensing changes
This commit is contained in:
1 parent
c1100e5398
commit
d46bfae4fc
235 files changed
+4468
-4725
No files matched your search
+8
-9
@@ -2,7 +2,6 @@
|
||||
using AutoFixture;
|
||||
using AutoFixture.AutoNSubstitute;
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Application.Core.FileSystemManagement.Paths.Commands.CombinePath;
|
||||
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Commands.CombinePath.Fixtures;
|
||||
using Lumina.Contracts.Responses.FileSystemManagement.Path;
|
||||
@@ -49,9 +48,9 @@ public class CombinePathCommandHandlerTests
|
||||
ErrorOr<PathSegmentResponse> result = await _sut.Handle(combinePathCommand, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Should().BeOfType<PathSegmentResponse>();
|
||||
result.Value.Path.Should().Be(combinedPath);
|
||||
Assert.False(result.IsError);
|
||||
Assert.IsType<PathSegmentResponse>(result.Value);
|
||||
Assert.Equal(combinedPath, result.Value.Path);
|
||||
_mockPathService.Received(1).CombinePath(combinePathCommand.OriginalPath!, combinePathCommand.NewPath!);
|
||||
}
|
||||
|
||||
@@ -68,8 +67,8 @@ public class CombinePathCommandHandlerTests
|
||||
ErrorOr<PathSegmentResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(error);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(error, result.FirstError);
|
||||
_mockPathService.Received(1).CombinePath(command.OriginalPath!, command.NewPath!);
|
||||
}
|
||||
|
||||
@@ -85,9 +84,9 @@ public class CombinePathCommandHandlerTests
|
||||
ErrorOr<PathSegmentResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Should().BeOfType<PathSegmentResponse>();
|
||||
result.Value.Path.Should().BeEmpty();
|
||||
Assert.False(result.IsError);
|
||||
Assert.IsType<PathSegmentResponse>(result.Value);
|
||||
Assert.Empty(result.Value.Path);
|
||||
_mockPathService.Received(1).CombinePath(command.OriginalPath!, command.NewPath!);
|
||||
}
|
||||
}
|
||||
+8
-9
@@ -2,7 +2,6 @@
|
||||
using AutoFixture;
|
||||
using AutoFixture.AutoNSubstitute;
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
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;
|
||||
@@ -57,15 +56,15 @@ public class SplitPathCommandHandlerTests
|
||||
ErrorOr<IEnumerable<PathSegmentResponse>> result = await _sut.Handle(splitPathCommand, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Should().BeAssignableTo<IEnumerable<PathSegmentResponse>>();
|
||||
result.Value.Should().HaveCount(pathSegments.Count());
|
||||
Assert.False(result.IsError);
|
||||
Assert.IsAssignableFrom<IEnumerable<PathSegmentResponse>>(result.Value);
|
||||
Assert.Equal(pathSegments.Count(), result.Value.Count());
|
||||
|
||||
List<PathSegmentResponse> resultList = result.Value.ToList();
|
||||
List<PathSegment> segmentsList = pathSegments.ToList();
|
||||
|
||||
for (int i = 0; i < resultList.Count; i++)
|
||||
resultList[i].Path.Should().Be(segmentsList[i].Name);
|
||||
Assert.Equal(segmentsList[i].Name, resultList[i].Path);
|
||||
_mockPathService.Received(1).ParsePath(splitPathCommand.Path!);
|
||||
}
|
||||
|
||||
@@ -82,8 +81,8 @@ public class SplitPathCommandHandlerTests
|
||||
ErrorOr<IEnumerable<PathSegmentResponse>> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(error);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(error, result.FirstError);
|
||||
_mockPathService.Received(1).ParsePath(command.Path!);
|
||||
}
|
||||
|
||||
@@ -100,8 +99,8 @@ public class SplitPathCommandHandlerTests
|
||||
ErrorOr<IEnumerable<PathSegmentResponse>> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Should().BeEmpty();
|
||||
Assert.False(result.IsError);
|
||||
Assert.Empty(result.Value);
|
||||
_mockPathService.Received(1).ParsePath(command.Path!);
|
||||
}
|
||||
}
|
||||
+12
-13
@@ -1,6 +1,5 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Application.Core.FileSystemManagement.Paths.Queries.CheckPathExists;
|
||||
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Queries.CheckPathExists.Fixtures;
|
||||
using Lumina.Contracts.Responses.FileSystemManagement.Path;
|
||||
@@ -42,8 +41,8 @@ public class CheckPathExistsQueryHandlerTests
|
||||
ErrorOr<PathExistsResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Exists.Should().BeTrue();
|
||||
Assert.False(result.IsError);
|
||||
Assert.True(result.Value.Exists);
|
||||
_mockPathService.Received(1).Exists(query.Path!);
|
||||
}
|
||||
|
||||
@@ -58,8 +57,8 @@ public class CheckPathExistsQueryHandlerTests
|
||||
ErrorOr<PathExistsResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Exists.Should().BeTrue();
|
||||
Assert.False(result.IsError);
|
||||
Assert.True(result.Value.Exists);
|
||||
_mockPathService.Received(1).Exists(query.Path!);
|
||||
}
|
||||
|
||||
@@ -74,8 +73,8 @@ public class CheckPathExistsQueryHandlerTests
|
||||
ErrorOr<PathExistsResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Exists.Should().BeFalse();
|
||||
Assert.False(result.IsError);
|
||||
Assert.False(result.Value.Exists);
|
||||
_mockPathService.Received(1).Exists(query.Path!, false);
|
||||
}
|
||||
|
||||
@@ -90,8 +89,8 @@ public class CheckPathExistsQueryHandlerTests
|
||||
ErrorOr<PathExistsResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Exists.Should().BeFalse();
|
||||
Assert.False(result.IsError);
|
||||
Assert.False(result.Value.Exists);
|
||||
_mockPathService.Received(1).Exists(query.Path!);
|
||||
}
|
||||
|
||||
@@ -106,8 +105,8 @@ public class CheckPathExistsQueryHandlerTests
|
||||
ErrorOr<PathExistsResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Exists.Should().BeFalse();
|
||||
Assert.False(result.IsError);
|
||||
Assert.False(result.Value.Exists);
|
||||
_mockPathService.Received(1).Exists(Arg.Any<string>(), Arg.Any<bool>());
|
||||
}
|
||||
|
||||
@@ -123,8 +122,8 @@ public class CheckPathExistsQueryHandlerTests
|
||||
ErrorOr<PathExistsResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Exists.Should().BeTrue();
|
||||
Assert.False(result.IsError);
|
||||
Assert.True(result.Value.Exists);
|
||||
_mockPathService.Received(1).Exists(query.Path!);
|
||||
}
|
||||
}
|
||||
+7
-8
@@ -2,7 +2,6 @@
|
||||
using AutoFixture;
|
||||
using AutoFixture.AutoNSubstitute;
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
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;
|
||||
@@ -56,9 +55,9 @@ public class GetPathParentQueryHandlerTests
|
||||
ErrorOr<IEnumerable<PathSegmentResponse>> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Should().BeAssignableTo<IEnumerable<PathSegmentResponse>>();
|
||||
result.Value.Should().BeEquivalentTo(pathSegmentResponses);
|
||||
Assert.False(result.IsError);
|
||||
Assert.IsAssignableFrom<IEnumerable<PathSegmentResponse>>(result.Value);
|
||||
Assert.Equal(pathSegmentResponses, result.Value);
|
||||
_mockPathService.Received(1).GoUpOneLevel(query.Path!);
|
||||
}
|
||||
|
||||
@@ -75,8 +74,8 @@ public class GetPathParentQueryHandlerTests
|
||||
ErrorOr<IEnumerable<PathSegmentResponse>> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(error);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(error, result.FirstError);
|
||||
_mockPathService.Received(1).GoUpOneLevel(query.Path!);
|
||||
}
|
||||
|
||||
@@ -93,8 +92,8 @@ public class GetPathParentQueryHandlerTests
|
||||
ErrorOr<IEnumerable<PathSegmentResponse>> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Should().BeEmpty();
|
||||
Assert.False(result.IsError);
|
||||
Assert.Empty(result.Value);
|
||||
_mockPathService.Received(1).GoUpOneLevel(query.Path!);
|
||||
}
|
||||
}
|
||||
+8
-9
@@ -1,6 +1,5 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
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;
|
||||
@@ -49,9 +48,9 @@ public class GetPathRootQueryHandlerTests
|
||||
ErrorOr<PathSegmentResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Should().NotBeNull();
|
||||
result.Value.Path.Should().Be(pathSegment.Name);
|
||||
Assert.False(result.IsError);
|
||||
Assert.NotNull(result.Value);
|
||||
Assert.Equal(pathSegment.Name, result.Value.Path);
|
||||
_mockPathService.Received(1).GetPathRoot(query.Path!);
|
||||
}
|
||||
|
||||
@@ -68,8 +67,8 @@ public class GetPathRootQueryHandlerTests
|
||||
ErrorOr<PathSegmentResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(error);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(error, result.FirstError);
|
||||
_mockPathService.Received(1).GetPathRoot(query.Path!);
|
||||
}
|
||||
|
||||
@@ -87,9 +86,9 @@ public class GetPathRootQueryHandlerTests
|
||||
ErrorOr<PathSegmentResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Should().NotBeNull();
|
||||
result.Value.Path.Should().Be("/");
|
||||
Assert.False(result.IsError);
|
||||
Assert.NotNull(result.Value);
|
||||
Assert.Equal("/", result.Value.Path);
|
||||
_mockPathService.Received(1).GetPathRoot(query.Path!);
|
||||
}
|
||||
}
|
||||
+9
-8
@@ -1,5 +1,4 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FluentAssertions;
|
||||
using Lumina.Application.Core.FileSystemManagement.Paths.Queries.GetPathSeparator;
|
||||
using Lumina.Contracts.Responses.FileSystemManagement.Path;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
@@ -42,8 +41,8 @@ public class GetPathSeparatorQueryHandlerTests
|
||||
PathSeparatorResponse result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.Should().NotBeNull();
|
||||
result.Separator.Should().Be(expectedSeparator.ToString());
|
||||
Assert.NotNull(result);
|
||||
Assert.Equal(expectedSeparator.ToString(), result.Separator);
|
||||
|
||||
_mockPathService.Received(1);
|
||||
}
|
||||
@@ -61,8 +60,8 @@ public class GetPathSeparatorQueryHandlerTests
|
||||
PathSeparatorResponse result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.Should().NotBeNull();
|
||||
result.Separator.Should().Be(separator.ToString());
|
||||
Assert.NotNull(result);
|
||||
Assert.Equal(separator.ToString(), result.Separator);
|
||||
_mockPathService.Received(1);
|
||||
}
|
||||
|
||||
@@ -79,7 +78,7 @@ public class GetPathSeparatorQueryHandlerTests
|
||||
PathSeparatorResponse result2 = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result1.Should().BeEquivalentTo(result2);
|
||||
Assert.Equal(result1, result2);
|
||||
_mockPathService.Received(2);
|
||||
}
|
||||
|
||||
@@ -91,9 +90,11 @@ public class GetPathSeparatorQueryHandlerTests
|
||||
using CancellationTokenSource cts = new();
|
||||
|
||||
// Act
|
||||
Func<Task> act = async () => await _sut.Handle(query, cts.Token);
|
||||
Exception? exception = await Record.ExceptionAsync(
|
||||
async () => await _sut.Handle(query, cts.Token)
|
||||
);
|
||||
|
||||
// Assert
|
||||
await act.Should().NotThrowAsync();
|
||||
Assert.Null(exception);
|
||||
}
|
||||
}
|
||||
+4
-5
@@ -1,5 +1,4 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using FluentAssertions;
|
||||
using Lumina.Application.Core.FileSystemManagement.Paths.Queries.ValidatePath;
|
||||
using Lumina.Application.UnitTests.Core.FileSystemManagement.Pahs.Queries.ValidatePath.Fixtures;
|
||||
using Lumina.Contracts.Responses.FileSystemManagement.Path;
|
||||
@@ -41,7 +40,7 @@ public class ValidatePathQueryHandlerTests
|
||||
PathValidResponse result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsValid.Should().BeTrue();
|
||||
Assert.True(result.IsValid);
|
||||
_mockPathService.Received(1).IsValidPath(query.Path!);
|
||||
}
|
||||
|
||||
@@ -56,7 +55,7 @@ public class ValidatePathQueryHandlerTests
|
||||
PathValidResponse result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsValid.Should().BeFalse();
|
||||
Assert.False(result.IsValid);
|
||||
_mockPathService.Received(1).IsValidPath(query.Path!);
|
||||
}
|
||||
|
||||
@@ -71,7 +70,7 @@ public class ValidatePathQueryHandlerTests
|
||||
PathValidResponse result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsValid.Should().BeFalse();
|
||||
Assert.False(result.IsValid);
|
||||
_mockPathService.Received(1).IsValidPath(Arg.Any<string>());
|
||||
}
|
||||
|
||||
@@ -86,7 +85,7 @@ public class ValidatePathQueryHandlerTests
|
||||
PathValidResponse result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsValid.Should().BeFalse();
|
||||
Assert.False(result.IsValid);
|
||||
_mockPathService.Received(1).IsValidPath(Arg.Any<string>());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user