public void OnClosedOverride_Test1() { const bool removeButtonOnClick = false; using (var f = new ButtonedForm(removeButtonOnClick)) { f.Show(); Assert.Null(f.onClosedForm.CatchedException, "An exception has been detected in `WndProc`"); } }
public void OnClosedOverride_Test2() { const bool removeButtonOnClick = true; var task = Task.Run(() => { using (var f = new ButtonedForm(removeButtonOnClick)) { f.Show(); } }); var ok = task.Wait(TimeSpan.FromSeconds(1)); Assert.True(ok, "Infinite loop has been detected in `WndProc`"); }