Also testing with a Pos and Dim null values.

This commit is contained in:
BDisp
2020-08-04 17:50:23 +01:00
parent 5efa8d5388
commit 8c5822f9e2
2 changed files with 8 additions and 2 deletions

View File

@@ -248,7 +248,9 @@ namespace Terminal.Gui {
Width = Dim.Width (w) - 2,
Height = Dim.Percent (10)
};
w.Add (v);
var vn = new View (new Rect (1, 2, 3, 3));
w.Add (v, vn);
t.Add (w);
t.Ready += () => {
@@ -258,6 +260,7 @@ namespace Terminal.Gui {
Assert.Equal (2, w.Height);
Assert.Throws<ArgumentException> (() => v.Width = 2);
Assert.Throws<ArgumentException> (() => v.Height = 2);
Assert.Equal (4, vn.Height = 4);
};
Application.Iteration += () => Application.RequestStop ();

View File

@@ -387,7 +387,9 @@ namespace Terminal.Gui {
X = Pos.Center (),
Y = Pos.Percent (10)
};
w.Add (v);
var vn = new View (new Rect (1, 3, 3, 4));
w.Add (v, vn);
t.Add (w);
t.Ready += () => {
@@ -397,6 +399,7 @@ namespace Terminal.Gui {
Assert.Equal (2, w.Y);
Assert.Throws<ArgumentException> (() => v.X = 2);
Assert.Throws<ArgumentException> (() => v.Y = 2);
Assert.Equal (2, vn.Y = 2);
};
Application.Iteration += () => Application.RequestStop ();