@@ -21,17 +21,33 @@ public void Should_Have_Start_Index_Zero()
2121 state . Index . ShouldBe ( 0 ) ;
2222 }
2323
24+ [ Theory ]
25+ [ InlineData ( ConsoleKey . DownArrow , true ) ]
26+ [ InlineData ( ConsoleKey . J , false ) ]
27+ public void Should_Increase_Index ( ConsoleKey key , bool wrap )
28+ {
29+ // Given
30+ var state = CreateListPromptState ( 100 , 10 , wrap , false ) ;
31+ var index = state . Index ;
32+
33+ // When
34+ state . Update ( key . ToConsoleKeyInfo ( ) ) ;
35+
36+ // Then
37+ state . Index . ShouldBe ( index + 1 ) ;
38+ }
39+
2440 [ Theory ]
2541 [ InlineData ( true ) ]
2642 [ InlineData ( false ) ]
27- public void Should_Increase_Index ( bool wrap )
43+ public void Should_Increase_Index_VimMotion ( bool wrap )
2844 {
2945 // Given
3046 var state = CreateListPromptState ( 100 , 10 , wrap , false ) ;
3147 var index = state . Index ;
3248
3349 // When
34- state . Update ( ConsoleKey . DownArrow . ToConsoleKeyInfo ( ) ) ;
50+ state . Update ( ConsoleKey . J . ToConsoleKeyInfo ( ) ) ;
3551
3652 // Then
3753 state . Index . ShouldBe ( index + 1 ) ;
@@ -52,42 +68,48 @@ public void Should_Go_To_End(bool wrap)
5268 state . Index . ShouldBe ( 99 ) ;
5369 }
5470
55- [ Fact ]
56- public void Should_Clamp_Index_If_No_Wrap ( )
71+ [ Theory ]
72+ [ InlineData ( ConsoleKey . DownArrow ) ]
73+ [ InlineData ( ConsoleKey . J ) ]
74+ public void Should_Clamp_Index_If_No_Wrap ( ConsoleKey key )
5775 {
5876 // Given
5977 var state = CreateListPromptState ( 100 , 10 , false , false ) ;
6078 state . Update ( ConsoleKey . End . ToConsoleKeyInfo ( ) ) ;
6179
6280 // When
63- state . Update ( ConsoleKey . DownArrow . ToConsoleKeyInfo ( ) ) ;
81+ state . Update ( key . ToConsoleKeyInfo ( ) ) ;
6482
6583 // Then
6684 state . Index . ShouldBe ( 99 ) ;
6785 }
6886
69- [ Fact ]
70- public void Should_Wrap_Index_If_Wrap ( )
87+ [ Theory ]
88+ [ InlineData ( ConsoleKey . DownArrow ) ]
89+ [ InlineData ( ConsoleKey . J ) ]
90+ public void Should_Wrap_Index_If_Wrap ( ConsoleKey key )
7191 {
7292 // Given
7393 var state = CreateListPromptState ( 100 , 10 , true , false ) ;
7494 state . Update ( ConsoleKey . End . ToConsoleKeyInfo ( ) ) ;
7595
7696 // When
77- state . Update ( ConsoleKey . DownArrow . ToConsoleKeyInfo ( ) ) ;
97+ state . Update ( key . ToConsoleKeyInfo ( ) ) ;
7898
7999 // Then
80100 state . Index . ShouldBe ( 0 ) ;
81101 }
82102
83- [ Fact ]
84- public void Should_Wrap_Index_If_Wrap_And_Down ( )
103+ [ Theory ]
104+ [ InlineData ( ConsoleKey . UpArrow ) ]
105+ [ InlineData ( ConsoleKey . K ) ]
106+ public void Should_Wrap_Index_If_Wrap_And_Down ( ConsoleKey key )
85107 {
86108 // Given
87109 var state = CreateListPromptState ( 100 , 10 , true , false ) ;
88110
89111 // When
90- state . Update ( ConsoleKey . UpArrow . ToConsoleKeyInfo ( ) ) ;
112+ state . Update ( key . ToConsoleKeyInfo ( ) ) ;
91113
92114 // Then
93115 state . Index . ShouldBe ( 99 ) ;
@@ -106,13 +128,15 @@ public void Should_Wrap_Index_If_Wrap_And_Page_Up()
106128 state . Index . ShouldBe ( 0 ) ;
107129 }
108130
109- [ Fact ]
110- public void Should_Wrap_Index_If_Wrap_And_Offset_And_Page_Down ( )
131+ [ Theory ]
132+ [ InlineData ( ConsoleKey . UpArrow ) ]
133+ [ InlineData ( ConsoleKey . K ) ]
134+ public void Should_Wrap_Index_If_Wrap_And_Offset_And_Page_Down ( ConsoleKey key )
111135 {
112136 // Given
113137 var state = CreateListPromptState ( 10 , 100 , true , false ) ;
114138 state . Update ( ConsoleKey . End . ToConsoleKeyInfo ( ) ) ;
115- state . Update ( ConsoleKey . UpArrow . ToConsoleKeyInfo ( ) ) ;
139+ state . Update ( key . ToConsoleKeyInfo ( ) ) ;
116140
117141 // When
118142 state . Update ( ConsoleKey . PageDown . ToConsoleKeyInfo ( ) ) ;
0 commit comments