Refactor collection and group suggestion handling to improve name comparison logic
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:
@@ -79,7 +79,7 @@ public class OmdbMetadataProviderTests
|
||||
Assert.Equal("Сериал", show.Title);
|
||||
Assert.Equal(2001, show.Year);
|
||||
Assert.Equal("описание", show.Overview);
|
||||
Assert.Equal(new[] { "Action", "Sci-Fi" }, show.Genres);
|
||||
Assert.Equal(["Action", "Sci-Fi"], show.Genres);
|
||||
Assert.Equal("TV-14", show.ContentRating);
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ public class OmdbMetadataProviderTests
|
||||
|
||||
var seasons = await Provider(http).GetSeasonNumbersAsync("tt1", CancellationToken.None);
|
||||
|
||||
Assert.Equal(new[] { 1, 2, 3 }, seasons);
|
||||
Assert.Equal([1, 2, 3], seasons);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user