ToolBarButtonTest.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //
  2. // ToolBarButtonTest.cs: Test cases for ToolBarButton.
  3. //
  4. // Author:
  5. // Chris Toshok ([email protected])
  6. //
  7. // (C) 2006 Novell, Inc. (http://www.novell.com)
  8. //
  9. using System;
  10. using NUnit.Framework;
  11. using System.Windows.Forms;
  12. using System.Drawing;
  13. using System.Runtime.Remoting;
  14. namespace MonoTests.System.Windows.Forms
  15. {
  16. [TestFixture]
  17. public class ToolBarButtonTest
  18. {
  19. [Test]
  20. public void CtorTest1 ()
  21. {
  22. ToolBarButton tbb = new ToolBarButton ();
  23. Assert.IsNull (tbb.DropDownMenu, "A3");
  24. Assert.IsTrue (tbb.Enabled, "A4");
  25. Assert.AreEqual (-1, tbb.ImageIndex, "A5");
  26. Assert.IsFalse (tbb.PartialPush, "A6");
  27. Assert.IsFalse (tbb.Pushed, "A7");
  28. Assert.AreEqual (Rectangle.Empty, tbb.Rectangle, "A8");
  29. Assert.AreEqual (ToolBarButtonStyle.PushButton, tbb.Style, "A8");
  30. Assert.IsNull (tbb.Tag, "A9");
  31. Assert.AreEqual ("", tbb.Text, "A10");
  32. Assert.AreEqual ("", tbb.ToolTipText, "A11");
  33. Assert.IsTrue (tbb.Visible, "A12");
  34. }
  35. [Test]
  36. public void CtorTest2 ()
  37. {
  38. ToolBarButton tbb = new ToolBarButton ("hi there");
  39. Assert.IsNull (tbb.DropDownMenu, "A3");
  40. Assert.IsTrue (tbb.Enabled, "A4");
  41. Assert.AreEqual (-1, tbb.ImageIndex, "A5");
  42. Assert.IsFalse (tbb.PartialPush, "A6");
  43. Assert.IsFalse (tbb.Pushed, "A7");
  44. Assert.AreEqual (Rectangle.Empty, tbb.Rectangle, "A8");
  45. Assert.AreEqual (ToolBarButtonStyle.PushButton, tbb.Style, "A8");
  46. Assert.IsNull (tbb.Tag, "A9");
  47. Assert.AreEqual ("hi there", tbb.Text, "A10");
  48. Assert.AreEqual ("", tbb.ToolTipText, "A11");
  49. Assert.IsTrue (tbb.Visible, "A12");
  50. }
  51. [Test]
  52. public void ToolTipText ()
  53. {
  54. ToolBarButton tbb = new ToolBarButton ();
  55. Assert.AreEqual ("", tbb.ToolTipText, "A1");
  56. tbb.ToolTipText = "hi there";
  57. Assert.AreEqual ("hi there", tbb.ToolTipText, "A2");
  58. tbb.ToolTipText = null;
  59. Assert.AreEqual ("", tbb.ToolTipText, "A3");
  60. }
  61. [Test]
  62. public void Text ()
  63. {
  64. ToolBarButton tbb = new ToolBarButton ();
  65. Assert.AreEqual ("", tbb.Text, "A1");
  66. tbb.Text = "hi there";
  67. Assert.AreEqual ("hi there", tbb.Text, "A2");
  68. tbb.Text = null;
  69. Assert.AreEqual ("", tbb.Text, "A3");
  70. }
  71. }
  72. }