Files
Terminal.Gui/UnitTests/ResponderTests.cs
BDisp 52f48b2044 Fixes #1384. Added a VisibleChanged event on the View class. (#1385)
* Fixes #1384. Added a VisibleChanged event on the View class.

* Getting the last char.

* Fixes #871. Added Enable property to Responder and added Disabled color for all ColorSchemes.

* Added GetNormalColor method to the View being more readable.

* Fixes the contentBottomRightCorner Enable and Visible.

* Fixes #643. Added AddItemAt and RemoveItem to StatusBar and fixed more bugs.

* Typo fixes.

* Fixes #1387. Allowing the UnitTests project to test internal keywords.

* Fixes #1389. Added a unidirectional feature to the Marquee styles to the ProgressBar.

* Fixes #1394. Added ReflectedType to check for overridden.

* Fixes #1396. Using the Loaded event instead the Ready event.

* Fixes #1402. Only WindowsDriver supports horizontal scroll. (#1403)

* Fixes #1402. Only WindowsDriver supports horizontal scroll.

* Fixes ProcessContinuousButtonPressedAsync on all drivers.

* Fixed internal unit test.

* Fixing warning.

* Fixing Editor scenario error.

* Fixes double and triple click on a touchpad.

* Ensuring reset the counting.

* Allowing touchpad double and triple click with one finger on CursesDriver.

* Allowing touchpad double and triple click with one finger on WindowsDriver.

* Fixes #1414. Fixed multi toplevels and mdi container issues.

* Improving EnsureVisibleBounds and PositionToplevel.

* Added mouseGrabView to the ResetState method.

* Changing namespace.

* Allowing file type on the SaveDialog.

* Fixes SaveDialogs writing the extension twice.
2021-08-11 02:56:30 -07:00

49 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using Terminal.Gui;
using Xunit;
// Alias Console to MockConsole so we don't accidentally use Console
using Console = Terminal.Gui.FakeConsole;
namespace Terminal.Gui.Core {
public class ResponderTests {
[Fact]
public void New_Initializes ()
{
var r = new Responder ();
Assert.NotNull (r);
Assert.Equal ("Terminal.Gui.Responder", r.ToString ());
Assert.False (r.CanFocus);
Assert.False (r.HasFocus);
Assert.True (r.Enabled);
Assert.True (r.Visible);
}
[Fact]
public void New_Methods_Return_False ()
{
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 (new View ()));
Assert.False (r.OnLeave (new View ()));
}
// Generic lifetime (IDisposable) tests
[Fact]
public void Dispose_Works ()
{
}
}
}