public void TestAcceptButton() { ExpectModal( "DialogWithNoHandlersForm", delegate { acceptButton = new ButtonTester("button1"); acceptButton.Click(); }); DialogWithNoHandlersForm form = new DialogWithNoHandlersForm(); DialogResult result = form.ShowDialog(); Assert.AreEqual(DialogResult.OK, result, "Wrong dialog result."); Assert.IsFalse(form.Visible, "Form was still visible."); }
public void TestAcceptButton() { ModalFormHandler = delegate(string name, System.IntPtr hWnd, System.Windows.Forms.Form fform) { acceptButton = new ButtonTester("button1"); acceptButton.Click(); }; DialogWithNoHandlersForm form = new DialogWithNoHandlersForm(); DialogResult result = form.ShowDialog(); Assert.AreEqual(DialogResult.OK, result, "Wrong dialog result."); Assert.IsFalse(form.Visible, "Form was still visible."); form.Close(); }
public void TestRejectButton() { ModalFormHandler = delegate(string name, System.IntPtr hWnd, System.Windows.Forms.Form fform) { rejectButton = new ButtonTester("button2"); rejectButton.Click(); }; DialogWithNoHandlersForm form = new DialogWithNoHandlersForm(); DialogResult result = form.ShowDialog(); Assert.Equal(DialogResult.Cancel, result); Assert.False(form.Visible, "Form was still visible."); form.Close(); }