Author: pbartok
Date: 2006-02-28 15:20:52 -0500 (Tue, 28 Feb 2006)
New Revision: 57428

Added:
   
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ComboBoxTests.cs
Modified:
   trunk/mcs/class/Managed.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms_test.dll.sources
   trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
Log:
2006-02-28  Matt Hergett  <[EMAIL PROTECTED]>

        * System.Windows.Forms_test.dll.sources: Added ComboBoxTests.cs

2006-02-28  Matt Hargett ([EMAIL PROTECTED])

        * ComboBoxTests.cs: Added



Modified: trunk/mcs/class/Managed.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/ChangeLog     2006-02-28 20:09:34 UTC 
(rev 57427)
+++ trunk/mcs/class/Managed.Windows.Forms/ChangeLog     2006-02-28 20:20:52 UTC 
(rev 57428)
@@ -1,3 +1,7 @@
+2006-02-28  Matt Hergett  <[EMAIL PROTECTED]>
+
+       * System.Windows.Forms_test.dll.sources: Added ComboBoxTests.cs
+
 2006-1-12  Jonathan Chambers  <[EMAIL PROTECTED]>
 
        * build-csproj: Fixed so the csproj is usable.

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms_test.dll.sources
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms_test.dll.sources 
2006-02-28 20:09:34 UTC (rev 57427)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms_test.dll.sources 
2006-02-28 20:20:52 UTC (rev 57428)
@@ -4,6 +4,7 @@
 System.Windows.Forms/CheckedListBoxEventTest.cs
 System.Windows.Forms/CheckedListBoxTest.cs
 System.Windows.Forms/ComboBoxTest.cs
+System.Windows.Forms/ComboBoxTests.cs
 System.Windows.Forms/Common.cs
 System.Windows.Forms/ControlEventTest.cs
 System.Windows.Forms/ControlTest.cs

Modified: 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog   
2006-02-28 20:09:34 UTC (rev 57427)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog   
2006-02-28 20:20:52 UTC (rev 57428)
@@ -1,3 +1,7 @@
+2006-02-28  Matt Hargett ([EMAIL PROTECTED])
+
+       * ComboBoxTests.cs: Added
+
 2006-02-02  Peter Dennis Bartok <[EMAIL PROTECTED]>
 
        * ControlTest.cs: Added test for layout nesting

Added: 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ComboBoxTests.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ComboBoxTests.cs
    2006-02-28 20:09:34 UTC (rev 57427)
+++ 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ComboBoxTests.cs
    2006-02-28 20:20:52 UTC (rev 57428)
@@ -0,0 +1,97 @@
+//
+// ComboBoxTests.cs: Test cases for ComboBox.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2006 Matt Hergett
+//                      
+// Authors:             
+//      Matt Hergett  <[EMAIL PROTECTED]>
+//
+
+
+using System.Windows.Forms;
+using System;
+using NUnit.Framework;
+
+[TestFixture]
+public class ComboBoxTests
+{
+       ComboBox comboBox;
+       bool textChanged, layoutUpdated;
+
+       [SetUp]
+       public void SetUp()
+       {
+               comboBox = new ComboBox();
+               textChanged = false;
+               layoutUpdated = false;
+               comboBox.TextChanged += new 
EventHandler(textChangedEventHandler);
+               comboBox.Layout += new LayoutEventHandler(layoutEventHandler);
+       }
+
+       private void textChangedEventHandler(object sender, EventArgs e)
+       {
+               textChanged = true;
+       }
+
+       private void layoutEventHandler(object sender, LayoutEventArgs e)
+       {
+               layoutUpdated = true;
+       }
+
+
+       [Test]
+       public void InitialPropertyValues()
+       {
+               
+               Assert.AreEqual(String.Empty, comboBox.Text);
+               Assert.AreEqual(-1, comboBox.SelectedIndex);
+               Assert.IsNull(comboBox.SelectedItem);
+               Assert.AreEqual(121, comboBox.Size.Width);
+               Assert.AreEqual(20, comboBox.Size.Height);
+               Assert.IsFalse(textChanged);
+               Assert.IsFalse(layoutUpdated);
+       }
+
+       [Test]
+       public void SetNegativeOneSelectedIndex()
+       {
+               comboBox.SelectedIndex = -1;
+               Assert.AreEqual(String.Empty, comboBox.Text);
+               Assert.IsFalse(textChanged);
+       }
+
+       [Test]
+       public void SetDifferentText()
+       {
+               comboBox.Text = "foooooooooooooooooooooooooo";
+               Assert.IsTrue(textChanged);
+               Assert.IsFalse(layoutUpdated);
+       }
+
+       [Test]
+       public void SetSameText()
+       {
+               comboBox.Text = String.Empty;
+               Assert.IsFalse(textChanged);
+               Assert.IsFalse(layoutUpdated);
+       }
+}

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to