Fixes #2451. ListView SelectedItem should be -1 by default.

This commit is contained in:
BDisp
2023-03-27 12:54:51 +01:00
parent 13ec890d11
commit d81bf050ee
5 changed files with 74 additions and 48 deletions

View File

@@ -35,12 +35,21 @@ namespace Terminal.Gui.TextTests {
[Fact]
public void Cycling ()
{
// cycling with 'b'
var n = new CollectionNavigator (simpleStrings);
Assert.Equal (2, n.GetNextMatchingItem (0, 'b'));
Assert.Equal (3, n.GetNextMatchingItem (2, 'b'));
// if 4 (candle) is selected it should loop back to bat
Assert.Equal (2, n.GetNextMatchingItem (4, 'b'));
// cycling with 'a'
n = new CollectionNavigator (simpleStrings);
Assert.Equal (0, n.GetNextMatchingItem (-1, 'a'));
Assert.Equal (1, n.GetNextMatchingItem (0, 'a'));
// if 4 (candle) is selected it should loop back to appricot
Assert.Equal (0, n.GetNextMatchingItem (4, 'a'));
}
[Fact]