using JSMR.Application.Scanning.Contracts;
using JSMR.Application.Scanning.Ports;
using Shouldly;

namespace JSMR.Tests.Extensions;

internal static class ScannerTestExtensions
{
    public static async Task<IReadOnlyList<DLSiteWork>> ScanWorksAsync(this IVoiceWorksScanner scanner, VoiceWorkScanOptions options)
    {
        VoiceWorkScanResult result = await scanner.ScanPageAsync(options, CancellationToken.None);

        result.EndOfResults.ShouldBeFalse();

        return result.Works;
    }
}