2009-06-06 Carlos Alberto Cortez <calberto.cortez@gmail.com>
[mono.git] / mcs / class / Managed.Windows.Forms / Test / System.Windows.Forms / TreeViewHitTestInfoTest.cs
1 //
2 // Copyright (c) 2007 Novell, Inc.
3 //
4 // Authors:
5 //     Jackson Harper (jackson@ximian.com)
6 //
7
8 using System;
9 using System.Windows.Forms;
10 using System.Drawing;
11 using System.Threading;
12 using System.ComponentModel;
13 using System.Runtime.Remoting;
14
15 using NUnit.Framework;
16
17 #if NET_2_0
18 namespace MonoTests.System.Windows.Forms {
19
20         [TestFixture]
21         public class TreeViewHitTestInfoTest : TestHelper {
22
23                 [Test]
24                 public void TestCtor ()
25                 {
26                         TreeViewHitTestInfo t = new TreeViewHitTestInfo (null, TreeViewHitTestLocations.None);
27
28                         Assert.AreEqual (t.Node, null, "null-1");
29                         Assert.AreEqual (t.Location, TreeViewHitTestLocations.None, "null-2");
30
31                         t = new TreeViewHitTestInfo (null, TreeViewHitTestLocations.Image);
32
33                         Assert.AreEqual (t.Node, null, "loc-1");
34                         Assert.AreEqual (t.Location, TreeViewHitTestLocations.Image, "loc-2");
35
36                         TreeNode tn = new TreeNode ("test");
37                         t = new TreeViewHitTestInfo (tn, TreeViewHitTestLocations.PlusMinus);
38
39                         Assert.AreEqual (t.Node, tn, "node-1");
40                         Assert.AreEqual (t.Location, TreeViewHitTestLocations.PlusMinus);
41                 }
42
43                 [Test]
44                 public void TestBadLocation ()
45                 {
46                         TreeViewHitTestInfo t = new TreeViewHitTestInfo (null, (TreeViewHitTestLocations) (-1));
47
48                         Assert.AreEqual (t.Node, null, "bad-loc-1");
49                         Assert.AreEqual ((int) t.Location, -1, "bad-loc-2");
50                 }
51         }
52
53 }
54 #endif