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.");
        }
Пример #2
0
        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();
        }
Пример #3
0
        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();
        }