Fixed CM bugs. Added unit tests. Trying to figure out why TryGet is not working properly

This commit is contained in:
Tig
2024-11-22 11:03:02 -07:00
parent 655118738b
commit c2c5a37ca7
27 changed files with 376 additions and 140 deletions

View File

@@ -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 ()
{

View File

@@ -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]