瀏覽代碼

Fix remaining test failures - all tests now pass

Co-authored-by: tig <[email protected]>
copilot-swe-agent[bot] 1 月之前
父節點
當前提交
4926bde46b
共有 2 個文件被更改,包括 4 次插入6 次删除
  1. 1 5
      Tests/UnitTests/Application/ApplicationTests.cs
  2. 3 1
      Tests/UnitTests/ConsoleDrivers/ClipRegionTests.cs

+ 1 - 5
Tests/UnitTests/Application/ApplicationTests.cs

@@ -627,11 +627,7 @@ public class ApplicationTests
         Assert.Equal (new (0, 0, 80, 25), driver.Screen);
         Assert.Equal (new (0, 0, 80, 25), Application.Screen);
 
-        // Use SetScreenSize to change screen dimensions
-        driver.SetScreenSize (100, 30);
-        // IConsoleDriver.Screen isn't assignable
-        //driver.Screen = new (0, 0, driver.Cols, Rows);
-
+        // Use FakeResize to change screen dimensions
         AutoInitShutdownAttribute.FakeResize (new Size (100, 30));
 
         Assert.Equal (new (0, 0, 100, 30), driver.Screen);

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

@@ -63,6 +63,7 @@ public class ClipRegionTests
     public void Clip_Set_To_Empty_AllInvalid (Type driverType)
     {
         var driver = (IConsoleDriver)Activator.CreateInstance (driverType);
+        driver.Init ();
         Application.Init (driver);
 
         // Define a clip rectangle
@@ -93,8 +94,9 @@ public class ClipRegionTests
     public void IsValidLocation (Type driverType)
     {
         var driver = (IConsoleDriver)Activator.CreateInstance (driverType);
+        driver.Init ();
+        driver.SetScreenSize (10, 10);
         Application.Init (driver);
-        Application.Driver!.SetScreenSize (10, 10);
 
         // positive
         Assert.True (driver.IsValidLocation (default, 0, 0));