mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Fixed more unit tests.
This commit is contained in:
@@ -166,7 +166,7 @@ namespace Terminal.Gui {
|
||||
/// </summary>
|
||||
static void Init (Func<Toplevel> topLevelFactory, ConsoleDriver driver = null, IMainLoopDriver mainLoopDriver = null)
|
||||
{
|
||||
if (_initialized) return;
|
||||
if (_initialized && driver == null) return;
|
||||
|
||||
// This supports Unit Tests and the passing of a mock driver/loopdriver
|
||||
if (driver != null) {
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace Terminal.Gui {
|
||||
public void Init_Inits ()
|
||||
{
|
||||
var driver = new FakeDriver ();
|
||||
Application.Init (driver, new NetMainLoop (() => FakeConsole.ReadKey (true)));
|
||||
driver.Init (() => { });
|
||||
|
||||
Assert.Equal (80, Console.BufferWidth);
|
||||
@@ -26,6 +27,7 @@ namespace Terminal.Gui {
|
||||
public void End_Cleans_Up ()
|
||||
{
|
||||
var driver = new FakeDriver ();
|
||||
Application.Init (driver, new NetMainLoop (() => FakeConsole.ReadKey (true)));
|
||||
driver.Init (() => { });
|
||||
|
||||
FakeConsole.ForegroundColor = ConsoleColor.Red;
|
||||
@@ -48,6 +50,7 @@ namespace Terminal.Gui {
|
||||
public void SetColors_Changes_Colors ()
|
||||
{
|
||||
var driver = new FakeDriver ();
|
||||
Application.Init (driver, new NetMainLoop (() => FakeConsole.ReadKey (true)));
|
||||
driver.Init (() => { });
|
||||
Assert.Equal (ConsoleColor.Gray, Console.ForegroundColor);
|
||||
Assert.Equal (ConsoleColor.Black, Console.BackgroundColor);
|
||||
|
||||
Reference in New Issue
Block a user