mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-28 08:47:59 +01:00
Refactor tests to decouple from global Application state
Commented out `driver ??= Application.Driver` assignments in `DriverAssert` to prevent automatic global driver assignment. Removed `Application.ResetState(true)` calls and commented out state validation assertions in `GlobalTestSetup` to reduce dependency on global state. Reintroduced `ApplicationForceDriverTests` and `ApplicationModelFencingTests` to validate `ForceDriver` behavior and ensure proper handling of legacy and modern Application models. Skipped certain `ToAnsiTests` that rely on `Application`. Removed direct `Application.Driver` assignments in `ViewDrawingClippingTests` and `ViewDrawingFlowTests`. Performed general cleanup of redundant code and unused imports to simplify the codebase.
This commit is contained in:
@@ -613,7 +613,6 @@ public class ViewDrawingFlowTests () : FakeDriverBase
|
||||
IDriver driver = CreateFakeDriver (80, 25);
|
||||
var initialClip = new Region (driver.Screen);
|
||||
driver.Clip = initialClip;
|
||||
Application.Driver = driver;
|
||||
|
||||
var view = new View
|
||||
{
|
||||
@@ -636,8 +635,6 @@ public class ViewDrawingFlowTests () : FakeDriverBase
|
||||
// Points inside the view should be excluded
|
||||
// Note: This test depends on the DrawContext tracking, which may not exclude if nothing was actually drawn
|
||||
// We're verifying the mechanism exists, not that it necessarily excludes in this specific case
|
||||
|
||||
Application.ResetState (true);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user