Remove FakeComponentFactory dependency on Examples namespace

- Removed Terminal.Gui.Examples using statement from FakeComponentFactory
- Removed key injection logic from FakeComponentFactory.CreateInput()
- Created ExampleContextInjector to handle key injection via Application.Driver.EnqueueKeyEvent
- Updated examples to call ExampleContextInjector.SetupAutomaticInjection() before Init
- This addresses @tig's comment to use Driver.EnqueueKeyEvent instead of direct FakeInput injection

Co-authored-by: tig <585482+tig@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-01 22:36:46 +00:00
parent 02b6aae484
commit bb24bf490f
5 changed files with 85 additions and 126 deletions

View File

@@ -20,6 +20,9 @@ using Terminal.Gui.Views;
ConfigurationManager.RuntimeConfig = """{ "Theme": "Light" }""";
ConfigurationManager.Enable (ConfigLocations.All);
// Setup automatic key injection for testing
ExampleContextInjector.SetupAutomaticInjection ();
// Check for test context to determine driver
string? contextJson = Environment.GetEnvironmentVariable (ExampleContext.ENVIRONMENT_VARIABLE_NAME);
string? driverName = null;