KeyEventArgsTest.cs 873 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. //
  3. // Author:
  4. // Rolf Bjarne Kvinge ([email protected])
  5. //
  6. // (C) 2007 Novell, Inc. (http://www.novell.com)
  7. //
  8. using System;
  9. using System.Windows.Forms;
  10. using System.Drawing;
  11. using System.Reflection;
  12. using System.ComponentModel;
  13. using NUnit.Framework;
  14. using System.Threading;
  15. namespace MonoTests.System.Windows.Forms
  16. {
  17. [TestFixture]
  18. public class KeyEventArgsTest : TestHelper
  19. {
  20. #if NET_2_0
  21. [Test]
  22. public void SuppressKeyPressTest ()
  23. {
  24. KeyEventArgs kea = new KeyEventArgs (Keys.L);
  25. Assert.IsFalse (kea.SuppressKeyPress, "#01");
  26. Assert.IsFalse (kea.Handled, "#02");
  27. kea.SuppressKeyPress = true;
  28. Assert.IsTrue (kea.SuppressKeyPress, "#03");
  29. Assert.IsTrue (kea.Handled, "#04");
  30. kea.SuppressKeyPress = false;
  31. Assert.IsFalse (kea.SuppressKeyPress, "#05");
  32. Assert.IsFalse (kea.Handled, "#06");
  33. }
  34. #endif
  35. }
  36. }