TreeViewHitTestInfoTest.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // Copyright (c) 2007 Novell, Inc.
  3. //
  4. // Authors:
  5. // Jackson Harper ([email protected])
  6. //
  7. using System;
  8. using System.Windows.Forms;
  9. using System.Drawing;
  10. using System.Threading;
  11. using System.ComponentModel;
  12. using System.Runtime.Remoting;
  13. using NUnit.Framework;
  14. #if NET_2_0
  15. namespace MonoTests.System.Windows.Forms {
  16. [TestFixture]
  17. public class TreeViewHitTestInfoTest {
  18. [Test]
  19. public void TestCtor ()
  20. {
  21. TreeViewHitTestInfo t = new TreeViewHitTestInfo (null, TreeViewHitTestLocations.None);
  22. Assert.AreEqual (t.Node, null, "null-1");
  23. Assert.AreEqual (t.Location, TreeViewHitTestLocations.None, "null-2");
  24. t = new TreeViewHitTestInfo (null, TreeViewHitTestLocations.Image);
  25. Assert.AreEqual (t.Node, null, "loc-1");
  26. Assert.AreEqual (t.Location, TreeViewHitTestLocations.Image, "loc-2");
  27. TreeNode tn = new TreeNode ("test");
  28. t = new TreeViewHitTestInfo (tn, TreeViewHitTestLocations.PlusMinus);
  29. Assert.AreEqual (t.Node, tn, "node-1");
  30. Assert.AreEqual (t.Location, TreeViewHitTestLocations.PlusMinus);
  31. }
  32. [Test]
  33. public void TestBadLocation ()
  34. {
  35. TreeViewHitTestInfo t = new TreeViewHitTestInfo (null, (TreeViewHitTestLocations) (-1));
  36. Assert.AreEqual (t.Node, null, "bad-loc-1");
  37. Assert.AreEqual ((int) t.Location, -1, "bad-loc-2");
  38. }
  39. }
  40. }
  41. #endif