Files
linux-packaging-mono/mcs/class/System.Windows.Forms/Test/System.Windows.Forms/TreeViewHitTestInfoTest.cs
Xamarin Public Jenkins 6992685b86 Imported Upstream version 4.2.0.179
Former-commit-id: 0a113cb3a6feb7873f632839b1307cc6033cd595
2015-11-10 14:54:39 +00: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");
}
}
}