Update search provider sort logic, and added testing for circle search provider.

This commit is contained in:
2025-08-30 16:21:35 -04:00
parent f221deea36
commit 516060963e
11 changed files with 435 additions and 143 deletions

View File

@@ -0,0 +1,28 @@
using JSMR.Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
namespace JSMR.Tests.Fixtures;
public class CircleSearchProviderFixture : MariaDbFixture
{
protected override async Task OnInitializedAsync(AppDbContext context)
{
await SeedAsync(context);
}
private static async Task SeedAsync(AppDbContext context)
{
// Make seeding idempotent (quick existence check)
if (await context.Circles.AnyAsync())
return;
context.Circles.AddRange(
new() { CircleId = 1, Name = "Good Dreams", MakerId = "RG00001" },
new() { CircleId = 2, Name = "Sweet Dreams", Favorite = true, MakerId = "RG00002" },
new() { CircleId = 3, Name = "Nightmare Fuel", Blacklisted = true, MakerId = "RG00003" },
new() { CircleId = 4, Name = "Garbage Studio", Spam = true, MakerId = "RG00004" }
);
await context.SaveChangesAsync();
}
}