mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
@@ -462,7 +462,7 @@ public class MessageBoxTests
|
||||
{
|
||||
MessageBox.Query (
|
||||
"",
|
||||
UICatalogApp.GetAboutBoxMessage (),
|
||||
UICatalog.UICatalogTopLevel.GetAboutBoxMessage (),
|
||||
wrapMessage: false,
|
||||
buttons: "_Ok"
|
||||
);
|
||||
|
||||
@@ -4146,7 +4146,7 @@ Nice Work")]
|
||||
{
|
||||
TextFormatter tf = new ()
|
||||
{
|
||||
Text = UICatalogApp.GetAboutBoxMessage (),
|
||||
Text = UICatalog.UICatalogTopLevel.GetAboutBoxMessage (),
|
||||
Alignment = Alignment.Center,
|
||||
VerticalAlignment = Alignment.Start,
|
||||
WordWrap = false,
|
||||
|
||||
@@ -129,6 +129,28 @@ public class KeyBindingsTests ()
|
||||
top.Dispose ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[AutoInitShutdown]
|
||||
public void HotKey_Enabled_False_Does_Not_Invoke ()
|
||||
{
|
||||
var view = new ScopedKeyBindingView ();
|
||||
var keyWasHandled = false;
|
||||
view.KeyDownNotHandled += (s, e) => keyWasHandled = true;
|
||||
|
||||
var top = new Toplevel ();
|
||||
top.Add (view);
|
||||
Application.Begin (top);
|
||||
|
||||
Application.RaiseKeyDownEvent (Key.Z);
|
||||
Assert.False (keyWasHandled);
|
||||
Assert.False (view.HotKeyCommand);
|
||||
|
||||
keyWasHandled = false;
|
||||
view.Enabled = false;
|
||||
Application.RaiseKeyDownEvent (Key.F);
|
||||
Assert.False (view.HotKeyCommand);
|
||||
top.Dispose ();
|
||||
}
|
||||
// tests that test KeyBindingScope.Focus and KeyBindingScope.HotKey (tests for KeyBindingScope.Application are in Application/KeyboardTests.cs)
|
||||
|
||||
public class ScopedKeyBindingView : View
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
3886
Tests/UnitTests/Views/Menuv1/MenuBarv1Tests.cs
Normal file
3886
Tests/UnitTests/Views/Menuv1/MenuBarv1Tests.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -4,10 +4,10 @@
|
||||
|
||||
namespace Terminal.Gui.ViewsTests;
|
||||
|
||||
public class MenuTests
|
||||
public class Menuv1Tests
|
||||
{
|
||||
private readonly ITestOutputHelper _output;
|
||||
public MenuTests (ITestOutputHelper output) { _output = output; }
|
||||
public Menuv1Tests (ITestOutputHelper output) { _output = output; }
|
||||
|
||||
// TODO: Create more low-level unit tests for Menu and MenuItem
|
||||
|
||||
Reference in New Issue
Block a user