Files
Terminal.Gui/UnitTests
Tig 707dbda71b Fixes #3072, #3148. Dialog and MessageBox key binding do not handle Enter correctly (#3151)
* Moved Command.Accept/Enter key binding from Toplevel to Dialog and added unit tests

* Dialog binds Esc to Command.QuitTopLevel

* Better Dialog key binding tests

* Better MessageBox key binding tests

* List of changes:
1. Removed explicit type casting for `Application.QuitKey` in `KeyBindings.Add` method calls. This indicates that `Application.QuitKey` is already of type `KeyCode`.
2. Removed explicit type casting for `Application.AlternateForwardKey` in `KeyBindings.Add` method calls. This suggests that `Application.AlternateForwardKey` is already of type `KeyCode`.
3. Removed explicit type casting for `Application.AlternateBackwardKey` in `KeyBindings.Add` method calls. This implies that `Application.AlternateBackwardKey` is already of type `KeyCode`.

References to the code changes:
1. `KeyBindings.Add((KeyCode)Application.QuitKey, QuitApplication);` changed to `KeyBindings.Add(Application.QuitKey, QuitApplication);`
2. `KeyBindings.Add((KeyCode)Application.AlternateForwardKey, MoveForward);` changed to `KeyBindings.Add(Application.AlternateForwardKey, MoveForward);`
3. `KeyBindings.Add((KeyCode)Application.AlternateBackwardKey, MoveBackward);` changed to `KeyBindings.Add(Application.AlternateBackwardKey, MoveBackward);`

* The `Command.Accept` command now directly calls the `OnClicked` method and returns `true`, effectively incorporating the behavior of the now-removed `AcceptKey` method.

* Moved Command.Accept/Enter key binding from Toplevel to Window and added unit tests
2024-01-10 13:22:18 -07:00
..
2021-04-25 10:18:31 -07:00
2023-10-04 06:42:47 -06:00

Automated Unit Tests

Terminal.Gui uses xunit for automated unit tests run automatically with Github Actions.

See the Testing wiki for details on how to add more tests.