2009-06-06 Carlos Alberto Cortez <calberto.cortez@gmail.com>
[mono.git] / mcs / class / Managed.Windows.Forms / Test / System.Windows.Forms / NotifyIconTest.cs
1 using System;
2 using NUnit.Framework;
3 using System.Drawing;
4 using System.Windows.Forms;
5 using System.ComponentModel;
6
7 namespace MonoTests.System.Windows.Forms
8 {
9         [TestFixture]
10         public class NotifyIconTest : TestHelper
11         {
12 #if NET_2_0
13                 [Test]
14                 public void PropertyTag ()
15                 {
16                         NotifyIcon ni = new NotifyIcon ();
17                         object o = "tomato";
18                         
19                         Assert.AreEqual (null, ni.Tag, "A1");
20                         
21                         ni.Tag = o;
22                         Assert.AreSame (o, ni.Tag, "A2");
23                 }
24
25                 [Test]
26                 public void PropertyContextMenuStrip ()
27                 {
28                         NotifyIcon ni = new NotifyIcon ();
29                         ContextMenuStrip cms = new ContextMenuStrip ();
30                         cms.Items.Add ("test item");
31
32                         Assert.AreEqual (null, ni.ContextMenuStrip, "B1");
33
34                         ni.ContextMenuStrip = cms;
35                         Assert.AreSame (cms, ni.ContextMenuStrip, "B2");
36                 }
37                 
38                 [Test]
39                 public void Balloon ()
40                 {
41                         NotifyIcon ni = new NotifyIcon ();
42                         ni.Text = "NotifyIcon Text";
43                         ni.BalloonTipTitle = "Balloon Tip Title";
44                         ni.BalloonTipText = "Balloon Tip Text.";
45                         ni.BalloonTipIcon = ToolTipIcon.None;
46                         ni.Visible = true;
47                         ni.ShowBalloonTip (1);
48                 }
49 #endif
50         }
51 }