Skip to content

armgit / Filee

Public Imported from GitHub
0

Free, open-source file converter. Convert 263 formats offline by drag & drop — images, PDF, Word, Excel, PowerPoint, HWP/HWPX, video, audio, e-books and archives. No upload, no Office needed.

Tests: the retry test waits for its conversion to end

KnifeLemonfdadac48dd18
diff --git a/tests/Filee.App.Tests/FailedFilesTests.cs b/tests/Filee.App.Tests/FailedFilesTests.cs
index 88681bf7..410f3fda 100644
--- a/tests/Filee.App.Tests/FailedFilesTests.cs
+++ b/tests/Filee.App.Tests/FailedFilesTests.cs
@@ -59,11 +59,21 @@ public class FailedFilesTests
item.RetryCommand.Execute(null);
- var job = conversions.Jobs[0].Job;
+ var retried = conversions.Jobs[0];
+ var job = retried.Job;
Assert.Equal([kept], job.Sources);
Assert.Equal("jpg", job.Preset.TargetFormat);
Assert.Equal(Path.Combine(folder, "out"), job.Preset.Output.CustomFolder);
+
+ // Let the job end inside the test: a conversion finishing after it would post to a dispatcher that is gone.
job.Cancel();
+ for (var i = 0; i < 200 && job.State is JobState.Queued or JobState.Running; i++)
+ {
+ Thread.Sleep(25);
+ Avalonia.Threading.Dispatcher.UIThread.RunJobs();
+ }
+ Avalonia.Threading.Dispatcher.UIThread.RunJobs();
+ retried.DismissCommand.Execute(null);
}
finally
{