Added English localization integration tests.
This commit is contained in:
@@ -3,16 +3,20 @@ using JSMR.Application.Tags.Queries.Search.Contracts;
|
||||
using JSMR.Infrastructure.Data;
|
||||
using JSMR.Infrastructure.Data.Repositories.Tags;
|
||||
using JSMR.Tests.Fixtures;
|
||||
using JSMR.Tests.Ingestion;
|
||||
using Shouldly;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace JSMR.Tests.Integration;
|
||||
|
||||
//[Collection("db")]
|
||||
public class TagSearchProviderTests(TagSearchProviderFixture fixture) : IClassFixture<TagSearchProviderFixture>
|
||||
{
|
||||
[Fact]
|
||||
public async Task Filter_None_Sort_Name()
|
||||
{
|
||||
await using AppDbContext context = fixture.CreateDbContext();
|
||||
//AppDbContext context = fixture.DbContext!;
|
||||
TagSearchProvider provider = new(context);
|
||||
|
||||
var options = new SearchOptions<TagSearchCriteria, TagSortField>()
|
||||
@@ -32,6 +36,7 @@ public class TagSearchProviderTests(TagSearchProviderFixture fixture) : IClassFi
|
||||
public async Task Filter_None_Sort_EnglishName()
|
||||
{
|
||||
await using AppDbContext context = fixture.CreateDbContext();
|
||||
//AppDbContext context = fixture.DbContext!;
|
||||
TagSearchProvider provider = new(context);
|
||||
|
||||
var options = new SearchOptions<TagSearchCriteria, TagSortField>()
|
||||
@@ -51,6 +56,7 @@ public class TagSearchProviderTests(TagSearchProviderFixture fixture) : IClassFi
|
||||
public async Task Filter_By_Name_Tag_Name()
|
||||
{
|
||||
await using AppDbContext context = fixture.CreateDbContext();
|
||||
//await using AppDbContext context = fixture.CreateDbContext();
|
||||
TagSearchProvider provider = new(context);
|
||||
|
||||
var options = new SearchOptions<TagSearchCriteria, TagSortField>()
|
||||
@@ -72,6 +78,7 @@ public class TagSearchProviderTests(TagSearchProviderFixture fixture) : IClassFi
|
||||
public async Task Filter_By_Name_English_Tag_Name()
|
||||
{
|
||||
await using AppDbContext context = fixture.CreateDbContext();
|
||||
//AppDbContext context = fixture.DbContext!;
|
||||
TagSearchProvider provider = new(context);
|
||||
|
||||
var options = new SearchOptions<TagSearchCriteria, TagSortField>()
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
using JSMR.Application.Scanning.Contracts;
|
||||
using JSMR.Infrastructure.Common.Time;
|
||||
using JSMR.Infrastructure.Data;
|
||||
using JSMR.Infrastructure.Ingestion;
|
||||
using JSMR.Tests.Fixtures;
|
||||
using NSubstitute;
|
||||
using Shouldly;
|
||||
|
||||
namespace JSMR.Tests.Integration;
|
||||
|
||||
public class VoiceWorkUpsertTests(VoiceWorkUpsertFixture fixture) : IClassFixture<VoiceWorkUpsertFixture>
|
||||
{
|
||||
[Fact]
|
||||
public async Task Simple_Upsert()
|
||||
{
|
||||
await using AppDbContext context = fixture.CreateDbContext();
|
||||
|
||||
VoiceWorkIngest[] ingests =
|
||||
[
|
||||
new()
|
||||
{
|
||||
MakerId = "RG00001",
|
||||
MakerName = "Good Dreams",
|
||||
ProductId = "A Newly Announced Work",
|
||||
Title = "",
|
||||
Description = ""
|
||||
},
|
||||
new()
|
||||
{
|
||||
MakerId = "RG00001",
|
||||
MakerName = "Sweet Dreams",
|
||||
ProductId = "",
|
||||
Title = "",
|
||||
Description = ""
|
||||
}
|
||||
];
|
||||
|
||||
IClock clock = Substitute.For<IClock>();
|
||||
clock.UtcNow.Returns(new DateTimeOffset(2025, 10, 1, 0, 0, 0, 0, TimeSpan.FromSeconds(0)));
|
||||
|
||||
TokyoTimeProvider timeProvider = new(clock);
|
||||
|
||||
VoiceWorkUpdater updater = new(context, timeProvider);
|
||||
await updater.UpsertAsync(ingests, CancellationToken.None);
|
||||
|
||||
context.VoiceWorks.Count().ShouldBe(2);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user