Added additional voice work update logic.
This commit is contained in:
47
JSMR.Tests/Integration/VoiceWorkUpsertTests.cs
Normal file
47
JSMR.Tests/Integration/VoiceWorkUpsertTests.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using JSMR.Application.Integrations.DLSite.Models;
|
||||
using JSMR.Application.Scanning.Contracts;
|
||||
using JSMR.Infrastructure.Common.Time;
|
||||
using JSMR.Infrastructure.Data;
|
||||
using JSMR.Infrastructure.Data.Repositories.VoiceWorks;
|
||||
using JSMR.Tests.Fixtures;
|
||||
using NSubstitute;
|
||||
using Shouldly;
|
||||
|
||||
namespace JSMR.Tests.Integration;
|
||||
|
||||
public class VoiceWorkUpsertTests(VoiceWorkUpsertFixture fixture) : IClassFixture<VoiceWorkUpsertFixture>
|
||||
{
|
||||
[Fact]
|
||||
public async Task Filter_None()
|
||||
{
|
||||
await using AppDbContext context = fixture.CreateDbContext();
|
||||
|
||||
ITimeProvider timeProvider = Substitute.For<ITimeProvider>();
|
||||
timeProvider.Now().Returns(new DateTimeOffset(2025, 10, 1, 0, 0, 0, 0, TimeSpan.FromSeconds(0)));
|
||||
|
||||
DLSiteWork work1 = new()
|
||||
{
|
||||
ProductId = "001",
|
||||
ProductName = "fdsfs",
|
||||
MakerId = "RG00001",
|
||||
Maker = "",
|
||||
ImageUrl = "",
|
||||
SmallImageUrl = ""
|
||||
};
|
||||
|
||||
VoiceWorkDetails details1 = new()
|
||||
{
|
||||
AgeRating = Application.Common.AgeRating.R18,
|
||||
};
|
||||
|
||||
VoiceWorkIngest[] ingests =
|
||||
[
|
||||
new(work1, details1)
|
||||
];
|
||||
|
||||
VoiceWorkWriter writer = new(context, timeProvider);
|
||||
await writer.UpsertAsync(ingests, CancellationToken.None);
|
||||
|
||||
context.VoiceWorks.Count().ShouldBe(2);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user