Migrated from .NET 9 to .NET 10.
This commit is contained in:
@@ -15,11 +15,11 @@ public sealed class VoiceWorkSearchProviderFixture(MariaDbContainerFixture conta
|
||||
);
|
||||
|
||||
context.VoiceWorks.AddRange(
|
||||
new() { VoiceWorkId = 1, CircleId = 1, ProductId = "RJ0000001", ProductName = "Today Sounds", Description = "An average product.", Status = (byte)VoiceWorkStatus.Available, SalesDate = new(2025, 1, 1), Downloads = 500, WishlistCount = 750, StarRating = 35 },
|
||||
new() { VoiceWorkId = 2, CircleId = 2, ProductId = "RJ0000002", ProductName = "Super Comfy ASMR", Description = "An amazing product!", Status = (byte)VoiceWorkStatus.NewRelease, SalesDate = new(2025, 1, 3), Downloads = 5000, WishlistCount = 12000, StarRating = 50, Favorite = true },
|
||||
new() { VoiceWorkId = 3, CircleId = 3, ProductId = "RJ0000003", ProductName = "Low Effort", Description = "A bad product.", Status = (byte)VoiceWorkStatus.Available, SalesDate = new(2025, 1, 2), Downloads = 50, WishlistCount = 100, StarRating = 20 },
|
||||
new() { VoiceWorkId = 4, CircleId = 1, ProductId = "RJ0000004", ProductName = "Tomorrow Sounds", Description = "A average upcoming product.", Status = (byte)VoiceWorkStatus.Upcoming, ExpectedDate = new(2025, 1, 1), WishlistCount = 300 },
|
||||
new() { VoiceWorkId = 5, CircleId = 2, ProductId = "RJ0000005", ProductName = "Super Comfy ASMR+", Description = "All your favorite sounds, plus more!", Status = (byte)VoiceWorkStatus.NewAndUpcoming, ExpectedDate = new(2025, 1, 11), PlannedReleaseDate = new(2025, 1, 13), WishlistCount = 10000 }
|
||||
new() { VoiceWorkId = 1, CircleId = 1, ProductId = "RJ0000001", ProductName = "Today Sounds", Description = "An average product.", Status = (byte)VoiceWorkStatus.Available, SalesDate = new(2025, 1, 1), Downloads = 500, WishlistCount = 750, StarRating = 35, SubtitleLanguage = (byte)Language.Japanese, Rating = (byte)AgeRating.AllAges, AIGeneration = (byte)AIGeneration.None },
|
||||
new() { VoiceWorkId = 2, CircleId = 2, ProductId = "RJ0000002", ProductName = "Super Comfy ASMR", Description = "An amazing product!", Status = (byte)VoiceWorkStatus.NewRelease, SalesDate = new(2025, 1, 3), Downloads = 5000, WishlistCount = 12000, StarRating = 50, Favorite = true, SubtitleLanguage = (byte)Language.Japanese, Rating = (byte)AgeRating.AllAges, AIGeneration = (byte)AIGeneration.None },
|
||||
new() { VoiceWorkId = 3, CircleId = 3, ProductId = "RJ0000003", ProductName = "Low Effort", Description = "A bad product.", Status = (byte)VoiceWorkStatus.Available, SalesDate = new(2025, 1, 2), Downloads = 50, WishlistCount = 100, StarRating = 20, SubtitleLanguage = (byte)Language.Japanese, Rating = (byte)AgeRating.R18, AIGeneration = (byte)AIGeneration.Partial },
|
||||
new() { VoiceWorkId = 4, CircleId = 1, ProductId = "RJ0000004", ProductName = "Tomorrow Sounds", Description = "A average upcoming product.", Status = (byte)VoiceWorkStatus.Upcoming, ExpectedDate = new(2025, 1, 1), WishlistCount = 300, SubtitleLanguage = (byte)Language.Japanese, Rating = (byte)AgeRating.AllAges, AIGeneration = (byte)AIGeneration.None },
|
||||
new() { VoiceWorkId = 5, CircleId = 2, ProductId = "RJ0000005", ProductName = "Super Comfy ASMR+", Description = "All your favorite sounds, plus more!", Status = (byte)VoiceWorkStatus.NewAndUpcoming, ExpectedDate = new(2025, 1, 11), PlannedReleaseDate = new(2025, 1, 13), WishlistCount = 10000, SubtitleLanguage = (byte)Language.English, Rating = (byte)AgeRating.R15, AIGeneration = (byte)AIGeneration.None }
|
||||
);
|
||||
|
||||
context.Tags.AddRange(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using JSMR.Application.Common.Search;
|
||||
using JSMR.Application.VoiceWorks.Queries.Search;
|
||||
using JSMR.Domain.Enums;
|
||||
using JSMR.Infrastructure.Data;
|
||||
using JSMR.Infrastructure.Data.Repositories.VoiceWorks;
|
||||
using Shouldly;
|
||||
@@ -651,4 +652,61 @@ public class VoiceWorkSearchProviderTests(VoiceWorkSearchProviderFixture fixture
|
||||
.Select(item => item.ProductId)
|
||||
.ShouldBe(["RJ0000002"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Filter_Language()
|
||||
{
|
||||
var options = new SearchOptions<VoiceWorkSearchCriteria, VoiceWorkSortField>()
|
||||
{
|
||||
Criteria = new()
|
||||
{
|
||||
SupportedLanguages = [Language.English]
|
||||
}
|
||||
};
|
||||
|
||||
var result = await SearchAsync(options);
|
||||
|
||||
result.Items
|
||||
.OrderBy(item => item.ProductId)
|
||||
.Select(item => item.ProductId)
|
||||
.ShouldBe(["RJ0000005"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Filter_Age_Rating()
|
||||
{
|
||||
var options = new SearchOptions<VoiceWorkSearchCriteria, VoiceWorkSortField>()
|
||||
{
|
||||
Criteria = new()
|
||||
{
|
||||
AgeRatings = [AgeRating.R15]
|
||||
}
|
||||
};
|
||||
|
||||
var result = await SearchAsync(options);
|
||||
|
||||
result.Items
|
||||
.OrderBy(item => item.ProductId)
|
||||
.Select(item => item.ProductId)
|
||||
.ShouldBe(["RJ0000005"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Filter_AI_Generation()
|
||||
{
|
||||
var options = new SearchOptions<VoiceWorkSearchCriteria, VoiceWorkSortField>()
|
||||
{
|
||||
Criteria = new()
|
||||
{
|
||||
AIGenerationOptions = [AIGeneration.Partial]
|
||||
}
|
||||
};
|
||||
|
||||
var result = await SearchAsync(options);
|
||||
|
||||
result.Items
|
||||
.OrderBy(item => item.ProductId)
|
||||
.Select(item => item.ProductId)
|
||||
.ShouldBe(["RJ0000003"]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user