mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
Attempting to figure out unit test fails and why tests are now slow. 2
This commit is contained in:
@@ -138,7 +138,7 @@ public class ApplicationMouseTests
|
||||
/// Tests that the mouse coordinates passed to the focused view are correct when the mouse is clicked. With
|
||||
/// Frames; Frame != Viewport
|
||||
/// </summary>
|
||||
[AutoInitShutdown]
|
||||
//[AutoInitShutdown]
|
||||
[Theory]
|
||||
|
||||
// click on border
|
||||
@@ -200,12 +200,12 @@ public class ApplicationMouseTests
|
||||
|
||||
var clicked = false;
|
||||
|
||||
var top = new Toplevel ();
|
||||
top.X = 0;
|
||||
top.Y = 0;
|
||||
top.Width = size.Width * 2;
|
||||
top.Height = size.Height * 2;
|
||||
top.BorderStyle = LineStyle.None;
|
||||
Application.Top = new Toplevel ();
|
||||
Application.Top.X = 0;
|
||||
Application.Top.Y = 0;
|
||||
Application.Top.Width = size.Width * 2;
|
||||
Application.Top.Height = size.Height * 2;
|
||||
Application.Top.BorderStyle = LineStyle.None;
|
||||
|
||||
var view = new View { X = pos.X, Y = pos.Y, Width = size.Width, Height = size.Height };
|
||||
|
||||
@@ -213,8 +213,8 @@ public class ApplicationMouseTests
|
||||
view.BorderStyle = LineStyle.Single;
|
||||
view.CanFocus = true;
|
||||
|
||||
top.Add (view);
|
||||
Application.Begin (top);
|
||||
Application.Top.Add (view);
|
||||
|
||||
var mouseEvent = new MouseEvent { Position = new (clickX, clickY), Flags = MouseFlags.Button1Clicked };
|
||||
|
||||
view.MouseClick += (s, e) =>
|
||||
@@ -226,7 +226,8 @@ public class ApplicationMouseTests
|
||||
|
||||
Application.OnMouseEvent (mouseEvent);
|
||||
Assert.Equal (expectedClicked, clicked);
|
||||
top.Dispose ();
|
||||
Application.Top.Dispose ();
|
||||
Application.ResetState (ignoreDisposed: true);
|
||||
}
|
||||
|
||||
#endregion mouse coordinate tests
|
||||
|
||||
Reference in New Issue
Block a user