diff --git a/OpenNest.WinForms.Tests/Forms/NestProgressFormLayoutsTests.cs b/OpenNest.WinForms.Tests/Forms/NestProgressFormLayoutsTests.cs index 3d4ff05c..a00072be 100644 --- a/OpenNest.WinForms.Tests/Forms/NestProgressFormLayoutsTests.cs +++ b/OpenNest.WinForms.Tests/Forms/NestProgressFormLayoutsTests.cs @@ -142,6 +142,71 @@ public class NestProgressFormLayoutsTests Assert.False(cts.IsCancellationRequested); }); + // Runs the form's timers until the task completes or the wait gives up. + private static void PumpUntil(Task task, TimeSpan max) + { + var waited = System.Diagnostics.Stopwatch.StartNew(); + while (!task.IsCompleted && waited.Elapsed < max) + { + Application.DoEvents(); + Thread.Sleep(5); + } + } + + private static Label Status(Form form) => + Assert.IsType