mirror of
https://github.com/cyanfish/naps2.git
synced 2024-10-26 17:11:21 +03:00
Fix OcrTestData tests to actually use the OCR path
This commit is contained in:
parent
8b50ad3baa
commit
8a9511d8a8
@ -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>();
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user