소스 검색

Fixed TextTests

Tig 1 년 전
부모
커밋
0bd21180de
1개의 변경된 파일14개의 추가작업 그리고 4개의 파일을 삭제
  1. 14 4
      UnitTests/View/TextTests.cs

+ 14 - 4
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)
     public void TextFormatter_Size_Tracks_ContentSize (string text, int expectedW, int expectedH)
     {
     {
         var view = new View ();
         var view = new View ();
-        view.SetContentSize (new (1,1));
+        view.SetContentSize (new (1, 1));
         view.Text = text;
         view.Text = text;
         Assert.Equal (new (expectedW, expectedH), view.TextFormatter.Size);
         Assert.Equal (new (expectedW, expectedH), view.TextFormatter.Size);
     }
     }
@@ -135,6 +135,7 @@ Y
 
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
         Application.End (rs);
         Application.End (rs);
+        top.Dispose ();
     }
     }
 
 
     [Fact]
     [Fact]
@@ -394,6 +395,7 @@ Y
 
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
         Application.End (rs);
         Application.End (rs);
+        top.Dispose ();
     }
     }
 
 
     [Fact]
     [Fact]
@@ -422,7 +424,7 @@ Y
 
 
         Assert.Equal (new (0, 0, 1, 5), view.Frame);
         Assert.Equal (new (0, 0, 1, 5), view.Frame);
         Assert.Equal (new (1, 5), view.TextFormatter.Size);
         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), win.Frame);
         Assert.Equal (new (0, 0, 4, 10), Application.Top.Frame);
         Assert.Equal (new (0, 0, 4, 10), Application.Top.Frame);
 
 
@@ -468,6 +470,7 @@ Y
 
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
         Assert.Equal (new (0, 0, 4, 10), pos);
         Assert.Equal (new (0, 0, 4, 10), pos);
+        top.Dispose ();
     }
     }
 
 
     [Fact]
     [Fact]
@@ -493,7 +496,7 @@ Y
         Assert.Equal (5, text.Length);
         Assert.Equal (5, text.Length);
         Assert.Equal (new (0, 0, 2, 5), view.Frame);
         Assert.Equal (new (0, 0, 2, 5), view.Frame);
         Assert.Equal (new (2, 5), view.TextFormatter.Size);
         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), win.Frame);
         Assert.Equal (new (0, 0, 4, 10), Application.Top.Frame);
         Assert.Equal (new (0, 0, 4, 10), Application.Top.Frame);
 
 
@@ -524,7 +527,7 @@ Y
 
 
         Exception exception = Record.Exception (
         Exception exception = Record.Exception (
                                                 () => Assert.Equal (
                                                 () => Assert.Equal (
-                                                                    new() { "界View" },
+                                                                    new () { "界View" },
                                                                     view.TextFormatter.GetLines ()
                                                                     view.TextFormatter.GetLines ()
                                                                    )
                                                                    )
                                                );
                                                );
@@ -545,6 +548,7 @@ Y
 
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
         Assert.Equal (new (0, 0, 4, 10), pos);
         Assert.Equal (new (0, 0, 4, 10), pos);
+        top.Dispose ();
     }
     }
 
 
     [Fact]
     [Fact]
@@ -641,6 +645,7 @@ Y
 
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
         Application.End (rs);
         Application.End (rs);
+        top.Dispose ();
     }
     }
 
 
     [Fact]
     [Fact]
@@ -737,6 +742,7 @@ Y
 
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
         Application.End (rs);
         Application.End (rs);
+        top.Dispose ();
     }
     }
 
 
     [Fact]
     [Fact]
@@ -772,6 +778,7 @@ Y
         }
         }
 
 
         Application.End (rs);
         Application.End (rs);
+        top.Dispose ();
     }
     }
 
 
     [Fact]
     [Fact]
@@ -820,6 +827,7 @@ Y
         Assert.Equal (new (0, 0, 2, 10), verticalView.Frame);
         Assert.Equal (new (0, 0, 2, 10), verticalView.Frame);
         Assert.Equal (new (2, 10), verticalView.GetSizeNeededForTextWithoutHotKey ());
         Assert.Equal (new (2, 10), verticalView.GetSizeNeededForTextWithoutHotKey ());
         Assert.Equal (verticalView.Frame.Size, verticalView.GetSizeNeededForTextWithoutHotKey ());
         Assert.Equal (verticalView.Frame.Size, verticalView.GetSizeNeededForTextWithoutHotKey ());
+        top.Dispose ();
     }
     }
 
 
     [Theory]
     [Theory]
@@ -942,6 +950,7 @@ Y
 
 
         Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
         Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
         Assert.Equal (new (0, 0, width + 2, 6), pos);
         Assert.Equal (new (0, 0, width + 2, 6), pos);
+        top.Dispose ();
     }
     }
 
 
     [Theory]
     [Theory]
@@ -1099,6 +1108,7 @@ Y
 
 
         Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
         Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
         Assert.Equal (new (0, 0, 9, height + 2), pos);
         Assert.Equal (new (0, 0, 9, height + 2), pos);
+        top.Dispose ();
     }
     }
 
 
     // Test that View.PreserveTrailingSpaces removes trailing spaces
     // Test that View.PreserveTrailingSpaces removes trailing spaces