Removes FluentAssertions library from test projects, due to licensing changes

This commit is contained in:
BinaryAlley committed 2025-02-03 00:31:15 +02:00
1 parent c1100e5398
commit d46bfae4fc
235 files changed
+4468 -4725

No files matched your search

@@ -1,5 +1,4 @@
#region ========================================================================= USING =====================================================================================
using FluentAssertions;
using Lumina.Application.Common.Mapping.MediaLibrary.Management;
using Lumina.Application.Core.MediaLibrary.Management.Commands.AddLibrary;
using Lumina.Contracts.Requests.MediaLibrary.Management;
@@ -34,15 +33,15 @@ public class AddMediaLibraryRequestMappingTests
AddLibraryCommand result = request.ToCommand();
// Assert
result.Should().NotBeNull();
result.Title.Should().Be(request.Title);
result.LibraryType.Should().Be(request.LibraryType);
result.ContentLocations.Should().BeEquivalentTo(request.ContentLocations);
result.CoverImage.Should().BeEquivalentTo(request.CoverImage);
result.IsEnabled.Should().Be(request.IsEnabled);
result.IsLocked.Should().Be(request.IsLocked);
result.DownloadMedatadaFromWeb.Should().Be(request.DownloadMedatadaFromWeb);
result.SaveMetadataInMediaDirectories.Should().Be(request.SaveMetadataInMediaDirectories);
Assert.NotNull(result);
Assert.Equal(request.Title, result.Title);
Assert.Equal(request.LibraryType, result.LibraryType);
Assert.Equal(request.ContentLocations, result.ContentLocations);
Assert.Equal(request.CoverImage, result.CoverImage);
Assert.Equal(request.IsEnabled, result.IsEnabled);
Assert.Equal(request.IsLocked, result.IsLocked);
Assert.Equal(request.DownloadMedatadaFromWeb, result.DownloadMedatadaFromWeb);
Assert.Equal(request.SaveMetadataInMediaDirectories, result.SaveMetadataInMediaDirectories);
}
[Theory]
@@ -68,15 +67,15 @@ public class AddMediaLibraryRequestMappingTests
AddLibraryCommand result = request.ToCommand();
// Assert
result.Should().NotBeNull();
result.Title.Should().Be(request.Title);
result.LibraryType.Should().Be(libraryType.ToString());
result.ContentLocations.Should().BeEquivalentTo(request.ContentLocations);
result.CoverImage.Should().BeEquivalentTo(request.CoverImage);
result.IsEnabled.Should().Be(request.IsEnabled);
result.IsLocked.Should().Be(request.IsLocked);
result.DownloadMedatadaFromWeb.Should().Be(request.DownloadMedatadaFromWeb);
result.SaveMetadataInMediaDirectories.Should().Be(request.SaveMetadataInMediaDirectories);
Assert.NotNull(result);
Assert.Equal(request.Title, result.Title);
Assert.Equal(libraryType.ToString(), result.LibraryType);
Assert.Equal(request.ContentLocations, result.ContentLocations);
Assert.Equal(request.CoverImage, result.CoverImage);
Assert.Equal(request.IsEnabled, result.IsEnabled);
Assert.Equal(request.IsLocked, result.IsLocked);
Assert.Equal(request.DownloadMedatadaFromWeb, result.DownloadMedatadaFromWeb);
Assert.Equal(request.SaveMetadataInMediaDirectories, result.SaveMetadataInMediaDirectories);
}
[Fact]
@@ -106,8 +105,8 @@ public class AddMediaLibraryRequestMappingTests
AddLibraryCommand result = request.ToCommand();
// Assert
result.Should().NotBeNull();
result.ContentLocations.Should().BeEquivalentTo(contentLocations);
Assert.NotNull(result);
Assert.Equal(contentLocations, result.ContentLocations);
}
[Fact]
@@ -135,7 +134,7 @@ public class AddMediaLibraryRequestMappingTests
AddLibraryCommand result = request.ToCommand();
// Assert
result.Should().NotBeNull();
result.CoverImage.Should().BeNull();
Assert.NotNull(result);
Assert.Null(result.CoverImage);
}
}
@@ -1,5 +1,4 @@
#region ========================================================================= USING =====================================================================================
using FluentAssertions;
using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
using Lumina.Application.Common.Mapping.MediaLibrary.Management;
using Lumina.Contracts.Responses.MediaLibrary.Management;
@@ -43,15 +42,15 @@ public class LibraryEntityMappingTests
LibraryResponse result = entity.ToResponse();
// Assert
result.Should().NotBeNull();
result.Id.Should().Be(entity.Id);
result.UserId.Should().Be(entity.UserId);
result.Title.Should().Be(entity.Title);
result.LibraryType.Should().Be(entity.LibraryType);
result.ContentLocations.Should().BeEquivalentTo(entity.ContentLocations.Select(l => l.Path));
result.CoverImage.Should().Be(entity.CoverImage);
result.CreatedOnUtc.Should().Be(entity.CreatedOnUtc);
result.UpdatedOnUtc.Should().Be(entity.UpdatedOnUtc);
Assert.NotNull(result);
Assert.Equal(entity.Id, result.Id);
Assert.Equal(entity.UserId, result.UserId);
Assert.Equal(entity.Title, result.Title);
Assert.Equal(entity.LibraryType, result.LibraryType);
Assert.Equal(entity.ContentLocations.Select(l => l.Path), result.ContentLocations);
Assert.Equal(entity.CoverImage, result.CoverImage);
Assert.Equal(entity.CreatedOnUtc, result.CreatedOnUtc);
Assert.Equal(entity.UpdatedOnUtc, result.UpdatedOnUtc);
}
[Theory]
@@ -80,8 +79,8 @@ public class LibraryEntityMappingTests
LibraryResponse result = entity.ToResponse();
// Assert
result.Should().NotBeNull();
result.LibraryType.Should().Be(libraryType);
Assert.NotNull(result);
Assert.Equal(libraryType, result.LibraryType);
}
[Fact]
@@ -112,8 +111,8 @@ public class LibraryEntityMappingTests
LibraryResponse result = entity.ToResponse();
// Assert
result.Should().NotBeNull();
result.ContentLocations.Should().BeEquivalentTo(entity.ContentLocations.Select(l => l.Path));
Assert.NotNull(result);
Assert.Equal(entity.ContentLocations.Select(l => l.Path), result.ContentLocations);
}
[Fact]
@@ -139,8 +138,8 @@ public class LibraryEntityMappingTests
LibraryResponse result = entity.ToResponse();
// Assert
result.Should().NotBeNull();
result.UpdatedOnUtc.Should().Be(updated);
Assert.NotNull(result);
Assert.Equal(updated, result.UpdatedOnUtc);
}
[Fact]
@@ -166,7 +165,7 @@ public class LibraryEntityMappingTests
LibraryResponse result = entity.ToResponse();
// Assert
result.Should().NotBeNull();
result.CoverImage.Should().BeNull();
Assert.NotNull(result);
Assert.Null(result.CoverImage);
}
}
@@ -1,6 +1,5 @@
#region ========================================================================= USING =====================================================================================
using ErrorOr;
using FluentAssertions;
using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
using Lumina.Application.Common.Mapping.Common.Metadata;
using Lumina.Application.Common.Mapping.MediaLibrary.Management;
@@ -42,20 +41,19 @@ public class LibraryMappingTests
LibraryEntity result = library.ToRepositoryEntity();
// Assert
result.Should().NotBeNull();
result.Id.Should().Be(library.Id.Value);
result.UserId.Should().Be(library.UserId.Value);
result.Title.Should().Be(library.Title);
result.LibraryType.Should().Be(library.LibraryType);
result.ContentLocations.Select(l => l.Path)
.Should().BeEquivalentTo(library.ContentLocations.Select(l => l.Path));
result.CoverImage.Should().BeEquivalentTo(library.CoverImage);
result.CreatedOnUtc.Should().Be(library.CreatedOnUtc);
result.UpdatedOnUtc.Should().Be(library.UpdatedOnUtc.HasValue ? library.UpdatedOnUtc : null);
result.IsEnabled.Should().BeTrue();
result.IsLocked.Should().BeFalse();
result.DownloadMedatadaFromWeb.Should().BeTrue();
result.SaveMetadataInMediaDirectories.Should().BeFalse();
Assert.NotNull(result);
Assert.Equal(library.Id.Value, result.Id);
Assert.Equal(library.UserId.Value, result.UserId);
Assert.Equal(library.Title, result.Title);
Assert.Equal(library.LibraryType, result.LibraryType);
Assert.Equal(library.ContentLocations.Select(l => l.Path), result.ContentLocations.Select(l => l.Path));
Assert.Equal(library.CoverImage, result.CoverImage);
Assert.Equal(library.CreatedOnUtc, result.CreatedOnUtc);
Assert.Equal(library.UpdatedOnUtc, result.UpdatedOnUtc);
Assert.True(result.IsEnabled);
Assert.False(result.IsLocked);
Assert.True(result.DownloadMedatadaFromWeb);
Assert.False(result.SaveMetadataInMediaDirectories);
}
[Fact]
@@ -79,9 +77,9 @@ public class LibraryMappingTests
LibraryEntity result = library.ToRepositoryEntity();
// Assert
result.Should().NotBeNull();
result.ContentLocations.Should().BeEmpty();
result.CoverImage.Should().BeEquivalentTo(library.CoverImage);
Assert.NotNull(result);
Assert.Empty(result.ContentLocations);
Assert.Equal(library.CoverImage, result.CoverImage);
}
[Theory]
@@ -109,13 +107,13 @@ public class LibraryMappingTests
LibraryEntity result = library.ToRepositoryEntity();
// Assert
result.Should().NotBeNull();
result.LibraryType.Should().Be(libraryType);
result.CoverImage.Should().BeEquivalentTo(library.CoverImage);
result.IsEnabled.Should().BeTrue();
result.IsLocked.Should().BeFalse();
result.DownloadMedatadaFromWeb.Should().BeTrue();
result.SaveMetadataInMediaDirectories.Should().BeFalse();
Assert.NotNull(result);
Assert.Equal(libraryType, result.LibraryType);
Assert.Equal(library.CoverImage, result.CoverImage);
Assert.True(result.IsEnabled);
Assert.False(result.IsLocked);
Assert.True(result.DownloadMedatadaFromWeb);
Assert.False(result.SaveMetadataInMediaDirectories);
}
[Fact]
@@ -147,10 +145,9 @@ public class LibraryMappingTests
LibraryEntity result = library.ToRepositoryEntity();
// Assert
result.Should().NotBeNull();
result.ContentLocations.Select(l => l.Path)
.Should().BeEquivalentTo(library.ContentLocations.Select(l => l.Path));
result.CoverImage.Should().BeEquivalentTo(library.CoverImage);
Assert.NotNull(result);
Assert.Equal(library.ContentLocations.Select(l => l.Path), result.ContentLocations.Select(l => l.Path));
Assert.Equal(library.CoverImage, result.CoverImage);
}
[Fact]
@@ -180,9 +177,8 @@ public class LibraryMappingTests
LibraryEntity result = library.ToRepositoryEntity();
// Assert
result.Should().NotBeNull();
result.ContentLocations.Select(l => l.Path)
.Should().BeEquivalentTo(library.ContentLocations.Select(l => l.Path));
result.CoverImage.Should().BeNull();
Assert.NotNull(result);
Assert.Equal(library.ContentLocations.Select(l => l.Path), result.ContentLocations.Select(l => l.Path));
Assert.Null(result.CoverImage);
}
}