mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-29 17:28:01 +01:00
Added and Removing tests.
This commit is contained in:
@@ -135,5 +135,26 @@ namespace Terminal.Gui {
|
||||
sub2.Width = Dim.Width (sub2);
|
||||
Assert.Throws<InvalidOperationException> (() => root.LayoutSubviews ());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Added_Removing ()
|
||||
{
|
||||
var v = new View (new Rect (0, 0, 10, 24));
|
||||
var t = new View ();
|
||||
|
||||
v.Added += (View e) => {
|
||||
Assert.True (v.SuperView == e);
|
||||
};
|
||||
|
||||
v.Removing += (View e) => {
|
||||
Assert.True (v.SuperView == e);
|
||||
};
|
||||
|
||||
t.Add (v);
|
||||
Assert.True (t.Subviews.Count == 1);
|
||||
|
||||
t.Remove (v);
|
||||
Assert.True (t.Subviews.Count == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user