File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,24 @@ public void Devices_Keyboard_SubscriptOperatorCanLookupKeyControlOfCorresponding
199199 }
200200 }
201201
202+ [ Test ( Description = "Verifies documented requirement 'This is equivalent to <c>allKeys[(int)key - 1]'" ) ]
203+ [ Category ( "Devices" ) ]
204+ public void Devices_Keyboard_SubscriptOperatorShouldBeEquivalentToShiftedAllKeysLookup ( )
205+ {
206+ var keyboard = InputSystem . AddDevice < Keyboard > ( ) ;
207+ var allKeys = keyboard . allKeys ;
208+ foreach ( var key in sKeys )
209+ {
210+ // Key.None is documented as an invalid key so skip it in this test.
211+ // Sub-script operator is documented to through for invalid key.
212+ if ( key == Key . None )
213+ continue ;
214+
215+ var keyControl = keyboard [ key ] ;
216+ Assert . That ( keyControl , Is . EqualTo ( allKeys [ ( int ) key - 1 ] ) ) ;
217+ }
218+ }
219+
202220 [ Test ]
203221 [ Category ( "Devices" ) ]
204222 public void Devices_Keyboard_SubscriptOperatorThrowsForInvalidOrOutOfRangeKey ( )
You can’t perform that action at this time.
0 commit comments