Refactor collection and group suggestion handling to improve name comparison logic
ci / build-backend (push) Successful in 1m25s
ci / build-frontend (push) Successful in 42s
ci / tests (push) Successful in 1m38s
ci / sonar (push) Successful in 6m30s

Updated the CreateCollectionFromSuggestionCommandHandler and CreateGroupFromSuggestionCommandHandler to compare names in memory rather than using SQL queries for case-insensitive checks. This change addresses potential discrepancies with SQL's case sensitivity, particularly with special characters. Additionally, modified unit tests to use array syntax for assertions, enhancing readability and consistency across the test suite.
This commit is contained in:
Leonid Pershin
2026-07-27 06:08:23 +03:00
parent 5ad28b2966
commit 97fa77287f
10 changed files with 67 additions and 41 deletions
@@ -97,7 +97,7 @@ public class TmdbMetadataProviderTests
Assert.Equal("Сериал", show.Title);
Assert.Equal(2001, show.Year);
// Идентификатор впереди названия, безымянный жанр — только идентификатором.
Assert.Equal(new[] { "tmdb:28", "Боевик", "Драма", "tmdb:99" }, show.Genres);
Assert.Equal(["tmdb:28", "Боевик", "Драма", "tmdb:99"], show.Genres);
// US приоритетнее RU, хотя в ответе идёт вторым.
Assert.Equal("TV-14", show.ContentRating);
}
@@ -236,7 +236,7 @@ public class TmdbMetadataProviderTests
var seasons = await Provider(http).GetSeasonNumbersAsync("42", CancellationToken.None);
Assert.Equal(new[] { 1, 2 }, seasons);
Assert.Equal([1, 2], seasons);
}
[Fact]