From 0bd21180de744727047de3f10d339ffd83ed7316 Mon Sep 17 00:00:00 2001 From: Tig Date: Thu, 30 May 2024 10:57:57 -0600 Subject: [PATCH] Fixed TextTests --- UnitTests/View/TextTests.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/UnitTests/View/TextTests.cs b/UnitTests/View/TextTests.cs index 05b896d72..f12f12ab6 100644 --- a/UnitTests/View/TextTests.cs +++ b/UnitTests/View/TextTests.cs @@ -32,7 +32,7 @@ public class TextTests (ITestOutputHelper output) public void TextFormatter_Size_Tracks_ContentSize (string text, int expectedW, int expectedH) { var view = new View (); - view.SetContentSize (new (1,1)); + view.SetContentSize (new (1, 1)); view.Text = text; Assert.Equal (new (expectedW, expectedH), view.TextFormatter.Size); } @@ -135,6 +135,7 @@ Y pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output); Application.End (rs); + top.Dispose (); } [Fact] @@ -394,6 +395,7 @@ Y pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output); Application.End (rs); + top.Dispose (); } [Fact] @@ -422,7 +424,7 @@ Y Assert.Equal (new (0, 0, 1, 5), view.Frame); Assert.Equal (new (1, 5), view.TextFormatter.Size); - Assert.Equal (new() { "Views" }, view.TextFormatter.GetLines ()); + Assert.Equal (new () { "Views" }, view.TextFormatter.GetLines ()); Assert.Equal (new (0, 0, 4, 10), win.Frame); Assert.Equal (new (0, 0, 4, 10), Application.Top.Frame); @@ -468,6 +470,7 @@ Y pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output); Assert.Equal (new (0, 0, 4, 10), pos); + top.Dispose (); } [Fact] @@ -493,7 +496,7 @@ Y Assert.Equal (5, text.Length); Assert.Equal (new (0, 0, 2, 5), view.Frame); Assert.Equal (new (2, 5), view.TextFormatter.Size); - Assert.Equal (new() { "界View" }, view.TextFormatter.GetLines ()); + Assert.Equal (new () { "界View" }, view.TextFormatter.GetLines ()); Assert.Equal (new (0, 0, 4, 10), win.Frame); Assert.Equal (new (0, 0, 4, 10), Application.Top.Frame); @@ -524,7 +527,7 @@ Y Exception exception = Record.Exception ( () => Assert.Equal ( - new() { "界View" }, + new () { "界View" }, view.TextFormatter.GetLines () ) ); @@ -545,6 +548,7 @@ Y pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output); Assert.Equal (new (0, 0, 4, 10), pos); + top.Dispose (); } [Fact] @@ -641,6 +645,7 @@ Y pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output); Application.End (rs); + top.Dispose (); } [Fact] @@ -737,6 +742,7 @@ Y pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output); Application.End (rs); + top.Dispose (); } [Fact] @@ -772,6 +778,7 @@ Y } Application.End (rs); + top.Dispose (); } [Fact] @@ -820,6 +827,7 @@ Y Assert.Equal (new (0, 0, 2, 10), verticalView.Frame); Assert.Equal (new (2, 10), verticalView.GetSizeNeededForTextWithoutHotKey ()); Assert.Equal (verticalView.Frame.Size, verticalView.GetSizeNeededForTextWithoutHotKey ()); + top.Dispose (); } [Theory] @@ -942,6 +950,7 @@ Y Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output); Assert.Equal (new (0, 0, width + 2, 6), pos); + top.Dispose (); } [Theory] @@ -1099,6 +1108,7 @@ Y Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output); Assert.Equal (new (0, 0, 9, height + 2), pos); + top.Dispose (); } // Test that View.PreserveTrailingSpaces removes trailing spaces