diff --git a/UnitTests/Views/ListViewTests.cs b/UnitTests/Views/ListViewTests.cs index a7ee74fc7c..835d0fe4e4 100644 --- a/UnitTests/Views/ListViewTests.cs +++ b/UnitTests/Views/ListViewTests.cs @@ -759,4 +759,39 @@ public void Clicking_On_Border_Is_Ignored () Assert.Equal ("Three", selected); Assert.Equal (2, lv.SelectedItem); } + + [Fact] + [AutoInitShutdown] + public void LeftItem_TopItem_Tests () + { + var source = new List (); + for (int i = 0; i < 5; i++) { + source.Add ($"Item {i}"); + } + var lv = new ListView () { + X = 1, + Width = 10, + Height = 5, + Source = new ListWrapper (source) + }; + var top = new Toplevel (); + top.Add (lv); + Application.Begin (top); + + TestHelpers.AssertDriverContentsWithFrameAre (@" + Item 0 + Item 1 + Item 2 + Item 3 + Item 4", _output); + + lv.LeftItem = 1; + lv.TopItem = 1; + Application.Refresh (); + TestHelpers.AssertDriverContentsWithFrameAre (@" + tem 1 + tem 2 + tem 3 + tem 4", _output); + } }