* Test/System.Windows.Forms/TestHelper.cs: Inconsistent eol fixes and
[mono.git] / mcs / class / Managed.Windows.Forms / Test / System.Windows.Forms / ListViewTest.cs
index 4b82865f67c162b2cdab26d6bf9ffb639c85153e..53571cd0f29c9bb08909bbca3cc0f15bd5d8ea7e 100644 (file)
@@ -18,7 +18,7 @@ using NUnit.Framework;
 namespace MonoTests.System.Windows.Forms
 {
        [TestFixture]
-       public class ListViewTest
+       public class ListViewTest : TestHelper
        {
                [Test]
                public void ListViewPropertyTest ()
@@ -77,6 +77,7 @@ namespace MonoTests.System.Windows.Forms
                        myform.Dispose ();
                }
 
+               // Hey
                [Test]
                public void BeginEndUpdateTest ()
                {
@@ -194,7 +195,8 @@ namespace MonoTests.System.Windows.Forms
                        Assert.IsNull(lv.StateImageList, "#B3");
                }
 
-               [Test]
+               // Hey
+               //[Test]
                public void EnsureVisibleTest ()
                {
                        Form myform = new Form ();
@@ -499,6 +501,41 @@ namespace MonoTests.System.Windows.Forms
                        }
                }
 
+               [Test]
+               public void FindNearestItem_Exceptions ()
+               {
+                       ListView lvw = new ListView ();
+                       lvw.Items.Add ("A");
+                       lvw.Items.Add ("B");
+
+                       lvw.View = View.Details;
+                       try {
+                               lvw.FindNearestItem (SearchDirectionHint.Down, 0, 0);
+                               Assert.Fail ("#A1");
+                       } catch (InvalidOperationException) {
+                       }
+
+                       lvw.View = View.List;
+                       try {
+                               lvw.FindNearestItem (SearchDirectionHint.Down, 0, 0);
+                               Assert.Fail ("#A2");
+                       } catch (InvalidOperationException) {
+                       }
+
+                       lvw.View = View.Tile;
+                       try {
+                               lvw.FindNearestItem (SearchDirectionHint.Down, 0, 0);
+                               Assert.Fail ("#A3");
+                       } catch (InvalidOperationException) {
+                       }
+
+                       lvw.View = View.LargeIcon;
+                       try {
+                               lvw.FindNearestItem ((SearchDirectionHint)666, 0, 0);
+                       } catch (ArgumentOutOfRangeException) {
+                       }
+               }
+
                [Test]
                public void FocusedItem ()
                {