From d6f634bfb9ffa51db728358c54c2bee8da7ebd73 Mon Sep 17 00:00:00 2001 From: Tig Kindel Date: Sun, 7 Jan 2024 06:22:23 -0700 Subject: [PATCH] New test --- UnitTests/Views/ToplevelTests.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/UnitTests/Views/ToplevelTests.cs b/UnitTests/Views/ToplevelTests.cs index bad9a326d..43f38e84a 100644 --- a/UnitTests/Views/ToplevelTests.cs +++ b/UnitTests/Views/ToplevelTests.cs @@ -1412,6 +1412,21 @@ public class ToplevelTests { Application.End (rs); } + [Fact] + [AutoInitShutdown] + public void Begin_With_Window_Sets_Size_Correctly () + { + var top = Application.Top; + Application.Begin (top); + ((FakeDriver)Application.Driver).SetBufferSize (20, 20); + + var testWindow = new Window () { X = 2, Y = 1, Width = 15, Height = 10 }; + Assert.Equal (new Rect (2, 1, 15, 10), testWindow.Frame); + + var rs = Application.Begin (testWindow); + Assert.Equal (new Rect (2, 1, 15, 10), testWindow.Frame); + } + // Don't use Dialog as a Top, use a Window instead - dialog has complex layout behavior that is not needed here. [Fact] [AutoInitShutdown]