Updated various parts of scanning and ingestion, either for bug fixes, or for enhancements.
This commit is contained in:
39
JSMR.Tests/Unit/DLSiteWorkTestFactory.cs
Normal file
39
JSMR.Tests/Unit/DLSiteWorkTestFactory.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using JSMR.Application.Scanning.Contracts;
|
||||
using JSMR.Domain.Enums;
|
||||
|
||||
namespace JSMR.Tests.Unit;
|
||||
|
||||
internal static class DLSiteWorkTestFactory
|
||||
{
|
||||
private static int _counter = 0;
|
||||
|
||||
public static DLSiteWork Create(DateOnly? expectedDate = null, DateOnly? salesDate = null)
|
||||
{
|
||||
int id = Interlocked.Increment(ref _counter);
|
||||
|
||||
return new DLSiteWork
|
||||
{
|
||||
ProductName = $"Test Product {id}",
|
||||
ProductId = $"RJ_TEST_{id:00000000}",
|
||||
Maker = "Test Maker",
|
||||
MakerId = "RG_TEST",
|
||||
ImageUrl = "//img.dlsite.jp/test_main.jpg",
|
||||
SmallImageUrl = "//img.dlsite.jp/test_sam.jpg",
|
||||
AgeRating = AgeRating.AllAges,
|
||||
|
||||
// Relevant fields for these tests:
|
||||
ExpectedDate = expectedDate,
|
||||
SalesDate = salesDate,
|
||||
|
||||
// The rest can be safe defaults:
|
||||
Downloads = 0,
|
||||
StarRating = null,
|
||||
Votes = null,
|
||||
Description = null,
|
||||
Genres = [],
|
||||
Tags = [],
|
||||
Creators = [],
|
||||
HasTrial = false
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user