public void EnsureCantReuseControls()
{
ConsoleProvider.Current = new CliUnitTestConsole();
ConsoleApp app = new ConsoleApp(0, 0, 80, 10);
var panel = app.LayoutRoot.Add(new ConsolePanel());
var button = panel.Add(new Button());
panel.Controls.Remove(button);
try
{
app.LayoutRoot.Add(button);
Assert.Fail("An exception should have been thrown");
}
catch (ObjectDisposedException ex)
{
Console.WriteLine(ex.Message);
}
}