Jo Shields 3c1f479b9d Imported Upstream version 4.0.0~alpha1
Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
2015-04-07 09:35:12 +01:00

53 lines
1.3 KiB
C#

//
// 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");
}
}
}