Example #1
0
        public void RichTextBox()
        {
            new RichTextBoxTestForm().Show();
            RichTextBoxTester box = new RichTextBoxTester("myTextBox");

            Assert.AreEqual("default", box.Text);
            box.Enter("Text");
            Assert.AreEqual("Text", box.Text);
        }
Example #2
0
        public void RichTextBox()
        {
            RichTextBoxTestForm f = new RichTextBoxTestForm();

            f.Show();
            RichTextBoxTester box = new RichTextBoxTester("myTextBox");

            Assert.Equal("default", box.Text);
            box.Enter("Text");
            Assert.Equal("Text", box.Text);
            f.Close();
        }
Example #3
0
        public void Show_WithException_ExceptionMessageSetToTextBox()
        {
            // Setup
            var mocks  = new MockRepository();
            var window = mocks.Stub <IWin32Window>();

            mocks.ReplayAll();

            var exception = new Exception("Test", new Exception("Test inner"));

            using (var dialog = new ExceptionDialog(window, null, exception))
            {
                // Call
                dialog.Show();

                // Assert
                var    textBox       = new RichTextBoxTester("exceptionTextBox");
                string exceptionText = textBox.Text;
                Assert.AreEqual(exception.ToString().Replace(Environment.NewLine, "\n"), exceptionText);
            }

            mocks.VerifyAll();
        }
Example #4
0
        public void Show_Always_ExpectedValues()
        {
            // Setup
            var mocks  = new MockRepository();
            var window = mocks.Stub <IWin32Window>();

            mocks.ReplayAll();

            using (var dialog = new ExceptionDialog(window, null, null))
            {
                // Call
                dialog.Show();

                // Assert
                Assert.AreEqual(470, dialog.MinimumSize.Width);
                Assert.AreEqual(200, dialog.MinimumSize.Height);

                var    textBox       = new RichTextBoxTester("exceptionTextBox");
                string exceptionText = textBox.Text;
                Assert.AreEqual("", exceptionText);
            }

            mocks.VerifyAll();
        }
 public void RichTextBox()
 {
     RichTextBoxTestForm f = new RichTextBoxTestForm();
     f.Show();
     RichTextBoxTester box = new RichTextBoxTester("myTextBox");
     Assert.Equal("default", box.Text);
     box.Enter("Text");
     Assert.Equal("Text", box.Text);
     f.Close();
 }