mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Add unit test for Screen.
This commit is contained in:
@@ -579,6 +579,25 @@ public class ApplicationTests
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Screen_Size_Changes ()
|
||||
{
|
||||
var driver = new FakeDriver ();
|
||||
Application.Init (driver);
|
||||
Assert.Equal (new (0, 0, 80, 25), driver.Screen);
|
||||
Assert.Equal (new (0, 0, 80, 25), Application.Screen);
|
||||
|
||||
driver.Cols = 100;
|
||||
driver.Rows = 30;
|
||||
// ConsoleDriver.Screen isn't assignable
|
||||
//driver.Screen = new (0, 0, driver.Cols, Rows);
|
||||
Assert.Equal (new (0, 0, 100, 30), driver.Screen);
|
||||
Assert.NotEqual (new (0, 0, 100, 30), Application.Screen);
|
||||
Assert.Equal (new (0, 0, 80, 25), Application.Screen);
|
||||
Application.Screen = new (0, 0, driver.Cols, driver.Rows);
|
||||
Assert.Equal (new (0, 0, 100, 30), driver.Screen);
|
||||
}
|
||||
|
||||
private void Init ()
|
||||
{
|
||||
Application.Init (new FakeDriver ());
|
||||
|
||||
Reference in New Issue
Block a user