Added Attributes tests; balanced Application.Init/Shutdown

This commit is contained in:
Charlie Kindel
2021-05-17 18:22:46 -07:00
parent 0fad21607b
commit 8d8025329e
19 changed files with 956 additions and 490 deletions

View File

@@ -23,6 +23,9 @@ namespace Terminal.Gui.ConsoleDrivers {
Assert.Equal (Console.BufferWidth, driver.Cols);
Assert.Equal (Console.BufferHeight, driver.Rows);
driver.End ();
// Shutdown must be called to safely clean up Application if Init has been called
Application.Shutdown ();
}
[Fact]
@@ -46,6 +49,9 @@ namespace Terminal.Gui.ConsoleDrivers {
Assert.Equal (0, Console.CursorTop);
Assert.Equal (ConsoleColor.Gray, Console.ForegroundColor);
Assert.Equal (ConsoleColor.Black, Console.BackgroundColor);
// Shutdown must be called to safely clean up Application if Init has been called
Application.Shutdown ();
}
[Fact]
@@ -67,6 +73,9 @@ namespace Terminal.Gui.ConsoleDrivers {
Assert.Equal (ConsoleColor.Gray, Console.ForegroundColor);
Assert.Equal (ConsoleColor.Black, Console.BackgroundColor);
driver.End ();
// Shutdown must be called to safely clean up Application if Init has been called
Application.Shutdown ();
}
[Fact]
@@ -94,6 +103,9 @@ namespace Terminal.Gui.ConsoleDrivers {
Application.Run ();
Assert.False (wasKeyPressed);
// Shutdown must be called to safely clean up Application if Init has been called
Application.Shutdown ();
}
[Fact]
@@ -133,6 +145,9 @@ namespace Terminal.Gui.ConsoleDrivers {
Application.Run ();
Assert.Equal ("MockKeyPresses", rText);
// Shutdown must be called to safely clean up Application if Init has been called
Application.Shutdown ();
}
[Fact]
@@ -226,6 +241,9 @@ namespace Terminal.Gui.ConsoleDrivers {
Application.Run ();
Assert.Equal (key, lastKey);
// Shutdown must be called to safely clean up Application if Init has been called
Application.Shutdown ();
}
}
}