From f6363554657ab0b429fa91ebe9d778bb3fa6bbe5 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 6 Dec 2006 19:01:24 +0000 Subject: [PATCH] * TextBoxTest.cs: Add a test for Modified property. - We need to put something on the clipboard before we can paste. svn path=/trunk/mcs/; revision=69129 --- .../Test/System.Windows.Forms/ChangeLog | 5 +++++ .../Test/System.Windows.Forms/TextBoxTest.cs | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog index cc67c608ea8..bf92aae2898 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2006-12-06 Jackson Harper + + * TextBoxTest.cs: Add a test for Modified property. + - We need to put something on the clipboard before we can paste. + 2006-12-04 Jackson Harper * TextBoxTest: More of these tests work now. diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TextBoxTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TextBoxTest.cs index fdc3a518ebe..999b33fcb63 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TextBoxTest.cs +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TextBoxTest.cs @@ -45,10 +45,14 @@ namespace MonoTests.System.Windows.Forms Assert.AreEqual (BorderStyle.Fixed3D, textBox.BorderStyle, "#5"); Assert.AreEqual (false, textBox.CanUndo, "#6a"); + + Clipboard.SetDataObject ("TEST"); textBox.Paste (); Assert.AreEqual (true, textBox.CanUndo, "#6b"); + textBox.Undo (); textBox.ClearUndo (); Assert.AreEqual (false, textBox.CanUndo, "#6c"); + Assert.AreEqual ("WindowText", textBox.ForeColor.Name, "#7"); Assert.AreEqual (true, textBox.HideSelection, "#8"); Assert.AreEqual (1, textBox.Lines.Length, "#9"); @@ -326,5 +330,21 @@ namespace MonoTests.System.Windows.Forms Assert.AreEqual (text, textBox.Text, "#2"); } + + + [Test] + public void ModifiedTest () + { + Assert.AreEqual (true, textBox.Modified, "modified-1"); + + textBox.Modified = false; + Assert.AreEqual (false, textBox.Modified, "modified-2"); + + textBox.Modified = true; + Assert.AreEqual (true, textBox.Modified, "modified-2"); + + textBox.Text = "TEXT"; + Assert.AreEqual (false, textBox.Modified, "modified-3"); + } } } -- 2.11.4.GIT