mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 16:59:35 +01:00
Rebased.
Fixed ApplicatonTests.
This commit is contained in:
@@ -40,10 +40,12 @@ public class ApplicationTests
|
||||
public void Begin_Sets_Application_Top_To_Console_Size ()
|
||||
{
|
||||
Assert.Null (Application.Top);
|
||||
Application.Begin (new ());
|
||||
Toplevel top = new ();
|
||||
Application.Begin (top);
|
||||
Assert.Equal (new (0, 0, 80, 25), Application.Top.Frame);
|
||||
((FakeDriver)Application.Driver).SetBufferSize (5, 5);
|
||||
Assert.Equal (new (0, 0, 5, 5), Application.Top.Frame);
|
||||
top.Dispose ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -347,6 +349,7 @@ public class ApplicationTests
|
||||
Assert.Null (Application.MouseGrabView); // public
|
||||
Assert.Null (Application.WantContinuousButtonPressedView); // public
|
||||
Assert.False (Application.MoveToOverlappedChild (Application.Top));
|
||||
Application.Top.Dispose ();
|
||||
}
|
||||
|
||||
// Invoke Tests
|
||||
|
||||
@@ -172,6 +172,7 @@ public class KeyboardTests
|
||||
Assert.True (win2.CanFocus);
|
||||
Assert.True (win2.HasFocus);
|
||||
Assert.Equal ("win2", ((Window)top.Subviews [^1]).Title);
|
||||
top.Dispose ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -224,6 +225,7 @@ public class KeyboardTests
|
||||
Assert.True (win2.CanFocus);
|
||||
Assert.False (win2.HasFocus);
|
||||
Assert.Equal ("win", ((Window)top.Subviews [^1]).Title);
|
||||
top.Dispose ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -358,6 +360,7 @@ public class KeyboardTests
|
||||
Assert.True (view.ApplicationCommand);
|
||||
Assert.True (view.HotKeyCommand);
|
||||
Assert.False (view.FocusedCommand);
|
||||
top.Dispose ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -385,6 +388,7 @@ public class KeyboardTests
|
||||
Assert.False (view.ApplicationCommand);
|
||||
Assert.False (view.HotKeyCommand);
|
||||
Assert.False (view.FocusedCommand);
|
||||
top.Dispose ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -423,6 +427,7 @@ public class KeyboardTests
|
||||
|
||||
// Reset the QuitKey to avoid throws errors on another tests
|
||||
Application.QuitKey = Key.Q.WithCtrl;
|
||||
top.Dispose ();
|
||||
}
|
||||
|
||||
// test Application key Bindings
|
||||
|
||||
@@ -640,6 +640,7 @@ public class MainLoopTests
|
||||
await task; // Propagate exception if any occurred
|
||||
|
||||
Assert.Equal (numIncrements * numPasses, tbCounter);
|
||||
top.Dispose ();
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -714,6 +715,7 @@ public class MainLoopTests
|
||||
};
|
||||
|
||||
Application.Run (top);
|
||||
top.Dispose ();
|
||||
|
||||
Assert.True (taskCompleted);
|
||||
Assert.Equal (clickMe, btn.Text);
|
||||
|
||||
@@ -130,6 +130,7 @@ public class MouseTests
|
||||
|
||||
Application.OnMouseEvent (mouseEvent);
|
||||
Assert.Equal (expectedClicked, clicked);
|
||||
top.Dispose ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -224,6 +225,7 @@ public class MouseTests
|
||||
|
||||
Application.OnMouseEvent (mouseEvent);
|
||||
Assert.Equal (expectedClicked, clicked);
|
||||
top.Dispose ();
|
||||
}
|
||||
|
||||
#endregion mouse coordinate tests
|
||||
@@ -290,6 +292,7 @@ public class MouseTests
|
||||
};
|
||||
|
||||
Application.Run (top);
|
||||
top.Dispose ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -396,6 +399,7 @@ public class MouseTests
|
||||
Application.OnMouseEvent (new () { Position = new (0, 0), Flags = MouseFlags.Button1Pressed });
|
||||
Assert.Null (Application.MouseGrabView);
|
||||
Assert.Equal (0, count);
|
||||
top.Dispose ();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user