From 8c5822f9e2a275f491915f9dd08af3254fac2531 Mon Sep 17 00:00:00 2001 From: BDisp Date: Tue, 4 Aug 2020 17:50:23 +0100 Subject: [PATCH] Also testing with a Pos and Dim null values. --- UnitTests/DimTests.cs | 5 ++++- UnitTests/PosTests.cs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/UnitTests/DimTests.cs b/UnitTests/DimTests.cs index b0c6097ac..90e02423d 100644 --- a/UnitTests/DimTests.cs +++ b/UnitTests/DimTests.cs @@ -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 (() => v.Width = 2); Assert.Throws (() => v.Height = 2); + Assert.Equal (4, vn.Height = 4); }; Application.Iteration += () => Application.RequestStop (); diff --git a/UnitTests/PosTests.cs b/UnitTests/PosTests.cs index 11e25ca2e..f16c05ba5 100644 --- a/UnitTests/PosTests.cs +++ b/UnitTests/PosTests.cs @@ -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 (() => v.X = 2); Assert.Throws (() => v.Y = 2); + Assert.Equal (2, vn.Y = 2); }; Application.Iteration += () => Application.RequestStop ();