StatusBarPanelTest.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. //
  2. // StatusBarPanelTest.cs: Test cases for StatusBar.
  3. //
  4. // (C) 2006 Novell, Inc. (http://www.novell.com)
  5. //
  6. using System;
  7. using NUnit.Framework;
  8. using System.Windows.Forms;
  9. using System.Drawing;
  10. using System.Runtime.Remoting;
  11. namespace MonoTests.System.Windows.Forms
  12. {
  13. [TestFixture]
  14. public class StatusBarPanelTest
  15. {
  16. [Test]
  17. public void MinimumWidth1 ()
  18. {
  19. StatusBarPanel p = new StatusBarPanel ();
  20. Assert.AreEqual (10, p.MinWidth, "1");
  21. }
  22. [Test]
  23. public void MinimumWidth2 ()
  24. {
  25. StatusBarPanel p = new StatusBarPanel ();
  26. p.Width = 50;
  27. p.MinWidth = 100;
  28. Assert.AreEqual (100, p.Width, "1");
  29. }
  30. [Test]
  31. public void MinimumWidth3 ()
  32. {
  33. StatusBarPanel p = new StatusBarPanel ();
  34. p.Width = 50;
  35. p.MinWidth = 200;
  36. p.MinWidth = 25;
  37. Assert.AreEqual (200, p.Width, "#1");
  38. p = new StatusBarPanel ();
  39. p.Width = 50;
  40. p.MinWidth = 25;
  41. Assert.AreEqual (50, p.Width, "#2");
  42. p = new StatusBarPanel ();
  43. p.Width = 50;
  44. p.MinWidth = 100;
  45. Assert.AreEqual (100, p.Width, "#3");
  46. p = new StatusBarPanel ();
  47. p.MinWidth = 200;
  48. Assert.AreEqual (200, p.Width, "#4");
  49. }
  50. [Test]
  51. public void MinWidth_AutoSize_None ()
  52. {
  53. StatusBarPanel p = new StatusBarPanel ();
  54. p.Width = 50;
  55. Assert.AreEqual (10, p.MinWidth, "#1");
  56. }
  57. [Test]
  58. public void ToStringTest ()
  59. {
  60. StatusBarPanel p = new StatusBarPanel ();
  61. Assert.AreEqual ("StatusBarPanel: {}", p.ToString(), "1");
  62. p.Text = "Hello";
  63. Assert.AreEqual ("StatusBarPanel: {Hello}", p.ToString(), "2");
  64. p.Text = "}";
  65. Assert.AreEqual ("StatusBarPanel: {}}", p.ToString(), "3");
  66. }
  67. [Test]
  68. public void DefaultPropertiesTest ()
  69. {
  70. StatusBarPanel p = new StatusBarPanel ();
  71. Assert.AreEqual (100, p.Width, "#1");
  72. Assert.AreEqual (10, p.MinWidth, "#2");
  73. Assert.AreEqual (String.Empty, p.Text, "#3");
  74. Assert.AreEqual (HorizontalAlignment.Left, p.Alignment, "#4");
  75. Assert.AreEqual (StatusBarPanelAutoSize.None, p.AutoSize, "#5");
  76. Assert.AreEqual (StatusBarPanelBorderStyle.Sunken, p.BorderStyle, "#6");
  77. Assert.AreEqual (StatusBarPanelStyle.Text, p.Style, "#7");
  78. Assert.AreEqual (String.Empty, p.ToolTipText, "#8");
  79. }
  80. }
  81. }