NotifyIconTest.cs 759 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using NUnit.Framework;
  3. using System.Drawing;
  4. using System.Windows.Forms;
  5. using System.ComponentModel;
  6. namespace MonoTests.System.Windows.Forms
  7. {
  8. [TestFixture]
  9. public class NotifyIconTest
  10. {
  11. #if NET_2_0
  12. [Test]
  13. public void PropertyTag ()
  14. {
  15. NotifyIcon ni = new NotifyIcon ();
  16. object o = "tomato";
  17. Assert.AreEqual (null, ni.Tag, "A1");
  18. ni.Tag = o;
  19. Assert.AreSame (o, ni.Tag, "A2");
  20. }
  21. [Test]
  22. public void PropertyContextMenuStrip ()
  23. {
  24. NotifyIcon ni = new NotifyIcon ();
  25. ContextMenuStrip cms = new ContextMenuStrip ();
  26. cms.Items.Add ("test item");
  27. Assert.AreEqual (null, ni.ContextMenuStrip, "B1");
  28. ni.ContextMenuStrip = cms;
  29. Assert.AreSame (cms, ni.ContextMenuStrip, "B2");
  30. }
  31. #endif
  32. }
  33. }