mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 16:59:35 +01:00
Add internal static InitState method to subscribe events.
This commit is contained in:
@@ -65,4 +65,24 @@ public class ApplicationScreenTests (ITestOutputHelper output)
|
||||
Application.Top = null;
|
||||
Application.Shutdown ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Screen_Changes_OnSizeChanged_Without_Call_Application_Init ()
|
||||
{
|
||||
// Arrange
|
||||
Application.ResetState (true);
|
||||
Assert.Null (Application.Driver);
|
||||
Application.Driver = new FakeDriver { Rows = 25, Cols = 25 };
|
||||
Application.InitState ();
|
||||
Assert.Equal (new (0, 0, 25, 25), Application.Screen);
|
||||
|
||||
// Act
|
||||
(((FakeDriver)Application.Driver)!).SetBufferSize (120, 30);
|
||||
|
||||
// Assert
|
||||
Assert.Equal (new (0, 0, 120, 30), Application.Screen);
|
||||
|
||||
// Cleanup
|
||||
Application.ResetState (true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -641,6 +641,12 @@ public class ApplicationTests
|
||||
Application.Shutdown ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InitState_Throws_If_Driver_Is_Null ()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException> (static () => Application.InitState ());
|
||||
}
|
||||
|
||||
private void Init ()
|
||||
{
|
||||
Application.Init (new FakeDriver ());
|
||||
|
||||
Reference in New Issue
Block a user