namespace MonoTests.System.Windows.Forms
{
[TestFixture]
- public class StatusBarPanelTest
+ public class StatusBarPanelTest : TestHelper
{
[Test]
public void MinimumWidth1 ()
}
[Test]
+#if NET_2_0
+ [ExpectedException (typeof (ArgumentOutOfRangeException))]
+#else
[ExpectedException(typeof(ArgumentException))]
+#endif
public void MinimumWidth4 ()
{
StatusBarPanel p = new StatusBarPanel ();
}
+ [Test] // bug 82487
+ public void IconWidth ()
+ {
+ using (Form f = new Form ()) {
+ StatusBar _statusBar;
+ StatusBarPanel _myComputerPanel;
+
+ _statusBar = new StatusBar ();
+ _statusBar.ShowPanels = true;
+ //Controls.Add (_statusBar);
+
+ _myComputerPanel = new StatusBarPanel ();
+ _myComputerPanel.AutoSize = StatusBarPanelAutoSize.Contents;
+ _myComputerPanel.Text = "My Computer";
+ _statusBar.Panels.Add (_myComputerPanel);
+
+ int width = _myComputerPanel.Width;
+
+ _myComputerPanel.Icon = f.Icon;
+
+ Assert.AreEqual (width + 21, _myComputerPanel.Width, "#01");
+ }
+ }
+#if NET_2_0
+ [Test]
+ public void TagTest ()
+ {
+ StatusBarPanel p = new StatusBarPanel ();
+
+ Assert.AreEqual (null, p.Tag, "#1");
+ p.Tag = "a";
+ Assert.AreEqual ("a", p.Tag, "#2");
+ p.Tag = null;
+ Assert.AreEqual (null, p.Tag, "#3");
+ }
+
+ [Test]
+ public void NameTest ()
+ {
+ StatusBarPanel p = new StatusBarPanel ();
+ Assert.AreEqual ("", p.Name, "#1");
+ p.Name = "a";
+ Assert.AreEqual ("a", p.Name, "#2");
+ p.Name = null;
+ Assert.AreEqual ("", p.Name, "#3");
+ }
+#endif
+
}
}