mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
Fixed CM bugs. Added unit tests. Trying to figure out why TryGet is not working properly
This commit is contained in:
@@ -331,6 +331,19 @@ public class KeyBindingTests
|
||||
}
|
||||
|
||||
// TryGet
|
||||
[Fact]
|
||||
public void TryGet_Succeeds ()
|
||||
{
|
||||
var keyBindings = new KeyBindings ();
|
||||
keyBindings.Add (Key.Q.WithCtrl, KeyBindingScope.Application, Command.HotKey);
|
||||
var key = new Key (Key.Q.WithCtrl);
|
||||
bool result = keyBindings.TryGet (key, out KeyBinding _);
|
||||
Assert.True (result);;
|
||||
|
||||
result = keyBindings.Bindings.TryGetValue (key, out KeyBinding _);
|
||||
Assert.True (result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TryGet_Unknown_ReturnsFalse ()
|
||||
{
|
||||
|
||||
@@ -532,6 +532,10 @@ public class KeyTests
|
||||
Key a = Key.A;
|
||||
Key b = Key.A;
|
||||
Assert.True (a.Equals (b));
|
||||
|
||||
b.Handled = true;
|
||||
Assert.False (a.Equals (b));
|
||||
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user