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