Fix OcrTestData tests to actually use the OCR path

This commit is contained in:
Ben Olden-Cooligan 2023-04-22 10:59:54 -07:00
parent 8b50ad3baa
commit 8a9511d8a8
3 changed files with 8 additions and 0 deletions

View File

@ -75,6 +75,8 @@ public class ContextualTests : IDisposable
new TesseractOcrEngine(tesseractPath, FolderPath, FolderPath);
}
public void SetUpFakeOcr() => SetUpFakeOcr(new());
public void SetUpFakeOcr(Dictionary<IMemoryImage, string> ocrTextByImage)
{
var ocrMock = new Mock<IOcrEngine>();

View File

@ -308,6 +308,7 @@ public class PdfExporterTests : ContextualTests
public async Task ExportProgress(OcrTestConfig config)
{
config.StorageConfig.Apply(this);
SetUpFakeOcr();
var progressMock = new Mock<ProgressCallback>();
@ -329,6 +330,7 @@ public class PdfExporterTests : ContextualTests
public async Task ExportCancellation(OcrTestConfig config)
{
config.StorageConfig.Apply(this);
SetUpFakeOcr();
var progressMock = new Mock<ProgressCallback>();
var cts = new CancellationTokenSource();

View File

@ -26,6 +26,7 @@ public class PdfImportExportTests : ContextualTests
public async Task ImportExport(OcrTestConfig config)
{
config.StorageConfig.Apply(this);
SetUpFakeOcr();
var images = await _importer.Import(_importPath).ToListAsync();
Assert.Equal(2, images.Count);
@ -39,6 +40,7 @@ public class PdfImportExportTests : ContextualTests
public async Task ImportInsertExport(OcrTestConfig config)
{
config.StorageConfig.Apply(this);
SetUpFakeOcr();
var images = await _importer.Import(_importPath).ToListAsync();
Assert.Equal(2, images.Count);
@ -60,6 +62,7 @@ public class PdfImportExportTests : ContextualTests
public async Task ImportTransformExport(OcrTestConfig config)
{
config.StorageConfig.Apply(this);
SetUpFakeOcr();
var images = await _importer.Import(_importPath).ToListAsync();
Assert.Equal(2, images.Count);
@ -117,6 +120,7 @@ public class PdfImportExportTests : ContextualTests
public async Task ImportExportEncrypted(OcrTestConfig config)
{
config.StorageConfig.Apply(this);
SetUpFakeOcr();
var images = await _importer.Import(_importPath).ToListAsync();
Assert.Equal(2, images.Count);