mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
* Refactored test namespaces. Moved some tests that were in wrong project. Code cleanup * Parrallel -> Parallel
28 lines
684 B
C#
28 lines
684 B
C#
// Alias Console to MockConsole so we don't accidentally use Console
|
|
|
|
namespace UnitTests_Parallelizable.InputTests;
|
|
|
|
public class ResponderTests
|
|
{
|
|
[Fact]
|
|
public void KeyPressed_Handled_True_Cancels_KeyPress ()
|
|
{
|
|
var r = new View ();
|
|
var args = new Key { KeyCode = KeyCode.Null };
|
|
|
|
Assert.False (r.NewKeyDownEvent (args));
|
|
Assert.False (args.Handled);
|
|
|
|
r.KeyDown += (s, a) => a.Handled = true;
|
|
Assert.True (r.NewKeyDownEvent (args));
|
|
Assert.True (args.Handled);
|
|
|
|
r.Dispose ();
|
|
}
|
|
|
|
public class DerivedView : View
|
|
{
|
|
protected override bool OnKeyDown (Key keyEvent) { return true; }
|
|
}
|
|
}
|