input keys test
authorJackson Harper <jackson@novell.com>
Mon, 19 Jun 2006 23:54:00 +0000 (23:54 -0000)
committerJackson Harper <jackson@novell.com>
Mon, 19 Jun 2006 23:54:00 +0000 (23:54 -0000)
svn path=/trunk/mcs/; revision=61867

mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TabControlTest.cs

index b32805f7faee7fc5684546c702489148ac4bfe38..1d4c3c9aa8e58b0e2d236228c190bb32e52ce927 100644 (file)
@@ -7,6 +7,7 @@
 // (C) 2005 Novell, Inc. (http://www.novell.com)
 //
 
+using System;
 using System.Drawing;
 using System.Windows.Forms;
 
@@ -20,6 +21,14 @@ namespace MonoTests.System.Windows.Forms {
        [TestFixture]
        public class TabControlTest
        {
+               private class TabControlPoker : TabControl {
+
+                       public bool CheckIsInputKey (Keys key)
+                       {
+                               return IsInputKey (key);
+                       }
+               }
+
                [Test]
                [Category ("NotWorking")]
                public void TabControlPropertyTest ()
@@ -138,6 +147,28 @@ namespace MonoTests.System.Windows.Forms {
                        c.SelectedIndex = 2; // beyond the pages - ignored
                        Assert.AreEqual (0, c.SelectedIndex, "#2");
                }
+
+               [Test]
+               public void InputKeyTest ()
+               {
+                       TabControlPoker p = new TabControlPoker ();
+
+                       foreach (Keys key in Enum.GetValues (typeof (Keys))) {
+                               switch (key) {
+                               case Keys.PageUp:
+                               case Keys.PageDown:
+                               case Keys.End:
+                               case Keys.Home:
+                                       continue;
+                               }
+                               Assert.IsFalse (p.CheckIsInputKey (key), "FALSE- " + key);
+                       }
+
+                       Assert.IsTrue (p.CheckIsInputKey (Keys.PageUp), "TRUE-pageup");
+                       Assert.IsTrue (p.CheckIsInputKey (Keys.PageDown), "TRUE-pagedown");
+                       Assert.IsTrue (p.CheckIsInputKey (Keys.End), "TRUE-end");
+                       Assert.IsTrue (p.CheckIsInputKey (Keys.Home), "TRUE-home");
+               }
        }
 
 }