Updated various parts of scanning and ingestion, either for bug fixes, or for enhancements.
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
using JSMR.Application.Scanning.Contracts;
|
||||
using JSMR.Application.Integrations.DLSite.Models;
|
||||
using JSMR.Application.Integrations.Ports;
|
||||
using JSMR.Application.Scanning.Contracts;
|
||||
using JSMR.Application.Scanning.Ports;
|
||||
using JSMR.Infrastructure.Http;
|
||||
using JSMR.Infrastructure.Scanning;
|
||||
using JSMR.Tests.Utilities;
|
||||
@@ -101,6 +104,51 @@ public class VoiceWorkScannerTests
|
||||
result[1].Tags.ShouldBe(["ASMR", "バイノーラル/ダミヘ", "色仕掛け", "浮気", "百合", "レズ/女同士", "ツルペタ", "貧乳/微乳"]);
|
||||
}
|
||||
|
||||
// (Scan) + (Integration) = <This> ==> Ingestion
|
||||
[Fact]
|
||||
public async Task Scan_And_Integration_Ingest_Mapping_Test()
|
||||
{
|
||||
IVoiceWorksScanner scanner = Substitute.For<IVoiceWorksScanner>();
|
||||
|
||||
IReadOnlyList<DLSiteWork> scannedWorks =
|
||||
[
|
||||
new()
|
||||
{
|
||||
ProductId = "RJ1",
|
||||
ProductName = "Masked Product Title",
|
||||
MakerId = "RG1",
|
||||
Maker = "Some Maker",
|
||||
ImageUrl = "https://site.com/image_main.png",
|
||||
SmallImageUrl = "https://site.com/image_240x240.png"
|
||||
}
|
||||
];
|
||||
|
||||
scanner.ScanPageAsync(Arg.Any<VoiceWorkScanOptions>(), CancellationToken.None)
|
||||
.Returns(Task.FromResult(scannedWorks));
|
||||
|
||||
IDLSiteClient dlsiteClient = Substitute.For<IDLSiteClient>();
|
||||
|
||||
VoiceWorkDetailCollection detailCollection = new()
|
||||
{
|
||||
{
|
||||
"RJ1",
|
||||
new VoiceWorkDetails()
|
||||
{
|
||||
Title = "Product Title"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
dlsiteClient.GetVoiceWorkDetailsAsync(Arg.Any<string[]>(), CancellationToken.None)
|
||||
.Returns(Task.FromResult(detailCollection));
|
||||
|
||||
VoiceWorkIngest ingest = VoiceWorkIngest.From(scannedWorks[0], detailCollection["RJ1"]);
|
||||
|
||||
// TODO: Test other fields
|
||||
ingest.Title.ShouldBe("Product Title");
|
||||
ingest.HasImage.ShouldBe(true);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Scan_With_English_Locale()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user