From 572901b5c011bd3773cf45076e1bccd0dc3ea642 Mon Sep 17 00:00:00 2001 From: Tig Date: Tue, 22 Oct 2024 12:29:12 -0600 Subject: [PATCH] Switched back to Application.Begin not calling Refresh --- UnitTests/Views/ScrollViewTests.cs | 6 ++++++ UnitTests/Views/TextViewTests.cs | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/UnitTests/Views/ScrollViewTests.cs b/UnitTests/Views/ScrollViewTests.cs index 37d2724b8..50c44d451 100644 --- a/UnitTests/Views/ScrollViewTests.cs +++ b/UnitTests/Views/ScrollViewTests.cs @@ -195,6 +195,7 @@ public class ScrollViewTests (ITestOutputHelper output) var top = new Toplevel (); top.Add (topLabel, sv, bottomLabel); Application.Begin (top); + Application.Refresh (); TestHelpers.AssertDriverContentsWithFrameAre ( @" @@ -460,6 +461,7 @@ public class ScrollViewTests (ITestOutputHelper output) var top = new Toplevel (); top.Add (sv); Application.Begin (top); + Application.Refresh (); Assert.Equal (new (-25, -25), sv.ContentOffset); Assert.Equal (new (50, 50), sv.GetContentSize ()); @@ -495,6 +497,7 @@ public class ScrollViewTests (ITestOutputHelper output) var top = new Toplevel (); top.Add (sv); Application.Begin (top); + Application.Refresh (); Assert.Equal (50, sv.GetContentSize ().Width); Assert.Equal (50, sv.GetContentSize ().Height); @@ -564,6 +567,7 @@ public class ScrollViewTests (ITestOutputHelper output) var top = new Toplevel (); top.Add (win); Application.Begin (top); + Application.Refresh (); var expected = @" ┌──────────────────┐ @@ -894,6 +898,7 @@ public class ScrollViewTests (ITestOutputHelper output) var top = new Toplevel (); top.Add (sv); Application.Begin (top); + Application.Refresh (); TestHelpers.AssertDriverContentsWithFrameAre ( @" @@ -1080,6 +1085,7 @@ public class ScrollViewTests (ITestOutputHelper output) var top = new Toplevel (); top.Add (sv); Application.Begin (top); + Application.Refresh (); Assert.Equal (4, sv.Subviews.Count); Assert.Equal (2, sv.Subviews [0].Subviews.Count); diff --git a/UnitTests/Views/TextViewTests.cs b/UnitTests/Views/TextViewTests.cs index 17693f07e..83ba93cc8 100644 --- a/UnitTests/Views/TextViewTests.cs +++ b/UnitTests/Views/TextViewTests.cs @@ -723,6 +723,7 @@ public class TextViewTests var top = new Toplevel (); top.Add (tv); Application.Begin (top); + Application.Refresh (); Assert.False (tv.WordWrap); Assert.Equal (Point.Empty, tv.CursorPosition); @@ -795,6 +796,7 @@ This is the second line. var top = new Toplevel (); top.Add (tv); Application.Begin (top); + Application.Refresh (); Assert.True (tv.WordWrap); Assert.Equal (Point.Empty, tv.CursorPosition); @@ -867,6 +869,7 @@ This is the second line. var top = new Toplevel (); top.Add (tv); Application.Begin (top); + Application.Refresh (); Assert.False (tv.WordWrap); Assert.Equal (Point.Empty, tv.CursorPosition); @@ -939,6 +942,7 @@ This is the second line. var top = new Toplevel (); top.Add (tv); Application.Begin (top); + Application.Refresh (); Assert.True (tv.WordWrap); Assert.Equal (Point.Empty, tv.CursorPosition); @@ -6996,6 +7000,7 @@ TAB to jump between text field", var top = new Toplevel (); top.Add (tv); Application.Begin (top); + Application.Refresh (); Assert.False (tv.WordWrap); Assert.Equal (Point.Empty, tv.CursorPosition); @@ -8168,6 +8173,7 @@ line. var top = new Toplevel (); top.Add (tv); Application.Begin (top); + Application.Refresh (); Assert.Equal (Point.Empty, tv.CursorPosition); Assert.Equal (0, tv.LeftColumn); @@ -8247,6 +8253,7 @@ a _textView.Text = "Line 1.\nLine 2."; _textView.WordWrap = true; Application.Begin (top); + Application.Refresh (); Assert.True (_textView.WordWrap); @@ -8903,6 +8910,7 @@ line. var top = new Toplevel (); top.Add (tv); Application.Begin (top); + Application.Refresh (); TestHelpers.AssertDriverContentsWithFrameAre ( @" @@ -8956,6 +8964,8 @@ line. ", var top = new Toplevel (); top.Add (tv); RunState rs = Application.Begin (top); + Application.Refresh (); + Assert.True (tv.InheritsPreviousAttribute); var expectedText = @"