|
@@ -0,0 +1,39 @@
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
+using Terminal.Gui;
|
|
|
+using Xunit;
|
|
|
+
|
|
|
+// Alais Console to MockConsole so we don't accidentally use Console
|
|
|
+using Console = Terminal.Gui.MockConsole;
|
|
|
+
|
|
|
+namespace Terminal.Gui {
|
|
|
+ public class ResponderTests {
|
|
|
+ [Fact]
|
|
|
+ public void TestNew ()
|
|
|
+ {
|
|
|
+ var r = new Responder ();
|
|
|
+ Assert.NotNull (r);
|
|
|
+ Assert.Equal ("Terminal.Gui.Responder", r.ToString ());
|
|
|
+ Assert.False (r.CanFocus);
|
|
|
+ Assert.False (r.HasFocus);
|
|
|
+ }
|
|
|
+
|
|
|
+ [Fact]
|
|
|
+ public void TestMethods ()
|
|
|
+ {
|
|
|
+ var r = new Responder ();
|
|
|
+
|
|
|
+ Assert.False (r.ProcessKey (new KeyEvent () { Key = Key.Unknown }));
|
|
|
+ Assert.False (r.ProcessHotKey (new KeyEvent () { Key = Key.Unknown }));
|
|
|
+ Assert.False (r.ProcessColdKey (new KeyEvent () { Key = Key.Unknown }));
|
|
|
+ Assert.False (r.OnKeyDown (new KeyEvent () { Key = Key.Unknown }));
|
|
|
+ Assert.False (r.OnKeyUp (new KeyEvent () { Key = Key.Unknown }));
|
|
|
+ Assert.False (r.MouseEvent (new MouseEvent () { Flags = MouseFlags.AllEvents }));
|
|
|
+ Assert.False (r.OnMouseEnter (new MouseEvent () { Flags = MouseFlags.AllEvents }));
|
|
|
+ Assert.False (r.OnMouseLeave (new MouseEvent () { Flags = MouseFlags.AllEvents }));
|
|
|
+ Assert.False (r.OnEnter ());
|
|
|
+ Assert.False (r.OnLeave ());
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|