Browse Source

Changes before error encountered

Co-authored-by: tig <[email protected]>
copilot-swe-agent[bot] 1 tháng trước cách đây
mục cha
commit
815a532754

+ 1 - 0
Terminal.Gui/Drivers/FakeDriver/FakeDriver.cs

@@ -98,6 +98,7 @@ public class FakeDriver : ConsoleDriver
         _cols = FakeConsole.WindowWidth = FakeConsole.BufferWidth = FakeConsole.WIDTH;
         _rows = FakeConsole.WindowHeight = FakeConsole.BufferHeight = FakeConsole.HEIGHT;
         FakeConsole.Clear ();
+        ClearContents ();
         ResizeScreen ();
         CurrentAttribute = new Attribute (Color.White, Color.Black);
     }

+ 2 - 1
Tests/UnitTests/ConsoleDrivers/ClipRegionTests.cs

@@ -25,8 +25,9 @@ public class ClipRegionTests
     public void AddRune_Is_Clipped (Type driverType)
     {
         var driver = (IConsoleDriver)Activator.CreateInstance (driverType);
+        driver.Init ();
+        driver.SetScreenSize (80, 25);
         Application.Init (driver);
-        Application.Driver!.SetScreenSize (80, 25);
 
         driver.Move (0, 0);
         driver.AddRune ('x');

+ 2 - 2
Tests/UnitTests/View/Adornment/MarginTests.cs

@@ -9,7 +9,7 @@ public class MarginTests (ITestOutputHelper output)
     [SetupFakeDriver]
     public void Margin_Is_Transparent ()
     {
-        ((IFakeConsoleDriver)Application.Driver!).SetBufferSize (5, 5);
+        Application.Driver!.SetScreenSize (5, 5);
 
         var view = new View { Height = 3, Width = 3 };
         view.Margin!.Diagnostics = ViewDiagnosticFlags.Thickness;
@@ -44,7 +44,7 @@ public class MarginTests (ITestOutputHelper output)
     [SetupFakeDriver]
     public void Margin_ViewPortSettings_Not_Transparent_Is_NotTransparent ()
     {
-        ((IFakeConsoleDriver)Application.Driver!).SetBufferSize (5, 5);
+        Application.Driver!.SetScreenSize (5, 5);
 
         var view = new View { Height = 3, Width = 3 };
         view.Margin!.Diagnostics = ViewDiagnosticFlags.Thickness;

+ 1 - 1
Tests/UnitTests/View/Adornment/PaddingTests.cs

@@ -9,7 +9,7 @@ public class PaddingTests (ITestOutputHelper output)
     [SetupFakeDriver]
     public void Padding_Uses_Parent_Scheme ()
     {
-        ((IFakeConsoleDriver)Application.Driver!).SetBufferSize (5, 5);
+        Application.Driver!.SetScreenSize (5, 5);
         var view = new View { Height = 3, Width = 3 };
         view.Padding!.Thickness = new (1);
         view.Padding.Diagnostics = ViewDiagnosticFlags.Thickness;

+ 1 - 1
Tests/UnitTests/View/Draw/ClipTests.cs

@@ -171,7 +171,7 @@ public class ClipTests (ITestOutputHelper _output)
     [Trait ("Category", "Unicode")]
     public void Clipping_Wide_Runes ()
     {
-        ((IFakeConsoleDriver)Application.Driver!).SetBufferSize (30, 1);
+        Application.Driver!.SetScreenSize (30, 1);
 
         var top = new View
         {