Verify no error log is generated in app tests

This commit is contained in:
Ben Olden-Cooligan 2022-06-27 21:12:22 -07:00
parent 6f5076d1ea
commit 0e23dccdbc
3 changed files with 8 additions and 0 deletions

View File

@ -66,4 +66,10 @@ public static class AppTestHelper
Assert.NotEqual(IntPtr.Zero, process.MainWindowHandle);
Assert.True(IsWindowVisible(process.MainWindowHandle));
}
public static void AssertNoErrorLog(string appData)
{
var path = Path.Combine(appData, "NAPS2", "errorlog.txt");
Assert.False(File.Exists(path));
}
}

View File

@ -15,6 +15,7 @@ public class WinFormsAppTests : ContextualTexts
Assert.Equal("Not Another PDF Scanner 2", process.MainWindowTitle);
Assert.True(process.CloseMainWindow());
Assert.True(process.WaitForExit(1000));
AppTestHelper.AssertNoErrorLog(FolderPath);
}
finally
{

View File

@ -17,6 +17,7 @@ public class WorkerAppTests : ContextualTexts
string pipeName = $"NAPS2.Worker/{process.Id}";
var client = new WorkerServiceAdapter(new NamedPipeChannel(".", pipeName));
client.Init(FolderPath);
AppTestHelper.AssertNoErrorLog(FolderPath);
}
finally
{