Added tag and creator tests.
This commit is contained in:
26
JSMR.Tests/Fixtures/CreatorSearchProviderFixture.cs
Normal file
26
JSMR.Tests/Fixtures/CreatorSearchProviderFixture.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using JSMR.Infrastructure.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace JSMR.Tests.Fixtures;
|
||||
|
||||
public class CreatorSearchProviderFixture : MariaDbFixture
|
||||
{
|
||||
protected override async Task OnInitializedAsync(AppDbContext context)
|
||||
{
|
||||
await SeedAsync(context);
|
||||
}
|
||||
|
||||
private static async Task SeedAsync(AppDbContext context)
|
||||
{
|
||||
if (await context.Tags.AnyAsync())
|
||||
return;
|
||||
|
||||
context.Creators.AddRange(
|
||||
new() { CreatorId = 1, Name = "John Smith" },
|
||||
new() { CreatorId = 2, Name = "John Doe", Favorite = true },
|
||||
new() { CreatorId = 3, Name = "Jane Doe", Blacklisted = true }
|
||||
);
|
||||
|
||||
await context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user