Explorar o código

Switched back to Application.Begin not calling Refresh

Tig hai 9 meses
pai
achega
572901b5c0
Modificáronse 2 ficheiros con 16 adicións e 0 borrados
  1. 6 0
      UnitTests/Views/ScrollViewTests.cs
  2. 10 0
      UnitTests/Views/TextViewTests.cs

+ 6 - 0
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);

+ 10 - 0
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 = @"