Updated integration testing for English and Japanese. Fixed minor voice work updater issue. Updated to XUnitV3.
This commit is contained in:
31
JSMR.Tests/Ingestion/Japanese/IngestionTestsBase.cs
Normal file
31
JSMR.Tests/Ingestion/Japanese/IngestionTestsBase.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using JSMR.Application.Scanning.Contracts;
|
||||
using JSMR.Application.Scanning.Ports;
|
||||
using JSMR.Infrastructure.Common.Time;
|
||||
using JSMR.Infrastructure.Data;
|
||||
using JSMR.Infrastructure.Ingestion;
|
||||
using JSMR.Tests.Fixtures;
|
||||
using NSubstitute;
|
||||
|
||||
namespace JSMR.Tests.Ingestion.Japanese;
|
||||
|
||||
public abstract class IngestionTestsBase(MariaDbContainerFixture container)
|
||||
{
|
||||
protected async Task<AppDbContext> GetAppDbContextAsync()
|
||||
{
|
||||
return await MariaTestDb.CreateIsolatedAsync(
|
||||
container.RootConnectionString,
|
||||
seed: VoiceWorkIngestionSeedData.SeedAsync);
|
||||
}
|
||||
|
||||
protected static async Task<VoiceWorkUpsertResult[]> UpsertAsync(AppDbContext dbContext, DateTime dateTime, VoiceWorkIngest[] ingests)
|
||||
{
|
||||
IClock clock = Substitute.For<IClock>();
|
||||
clock.UtcNow.Returns(new DateTimeOffset(dateTime));
|
||||
|
||||
TokyoTimeProvider timeProvider = new(clock);
|
||||
|
||||
VoiceWorkUpdater updater = new(dbContext, timeProvider);
|
||||
|
||||
return await updater.UpsertAsync(ingests, TestContext.Current.CancellationToken);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user