mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 16:59:35 +01:00
Added @bdisp's suggested tests
This commit is contained in:
@@ -70,7 +70,7 @@ namespace Terminal.Gui.Core {
|
||||
Assert.Equal (80, Application.Driver.Cols);
|
||||
Assert.Equal (25, Application.Driver.Rows);
|
||||
|
||||
// Because of #520, the Toplevel created by Application.Init is not disposed by Shutdown
|
||||
// BUGBUG: Because of #520, the Toplevel created by Application.Init is not disposed by Shutdown
|
||||
// So we need to dispose it manually
|
||||
Application.Top.Dispose ();
|
||||
|
||||
@@ -87,6 +87,20 @@ namespace Terminal.Gui.Core {
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Init_Shutdown_Toplevel_Not_Disposed ()
|
||||
{
|
||||
Application.Init (new FakeDriver (), new FakeMainLoop (() => FakeConsole.ReadKey (true)));
|
||||
|
||||
Application.Shutdown ();
|
||||
|
||||
Assert.Single (Responder.Instances);
|
||||
foreach (var inst in Responder.Instances) {
|
||||
// BUGBUG: Because of #520, the Toplevel created by Application.Init is not disposed by Shutdown
|
||||
Assert.False (inst.WasDisposed);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Init_Unbalanced_Throwss ()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user