# GitConverter.TestsApp.ConsoleApp Integration tests that exercise the ConsoleApp entry point (Program.Run) end-to-end using reflection. ## Purpose - Verify CLI parsing, argument repair, logging and that host wiring dispatches conversions correctly. - Run Program.Run via reflection so tests do not call Environment.Exit and can assert exit codes and console output. ## Key tests - Program.Run help / no-args behavior. - Unknown conversion option handling. - Repair of unquoted input path tokens (debug convenience). - End-to-end conversion tests that call Program.Run with sample archives/files for Shapefile, Csv and Gml. ## How tests locate Program.Run Tests attempt to locate `GitConverter.ConsoleApp.Program` using a robust search strategy: 1. Type.GetType lookup. 2. Assembly.Load by name. 3. Probe `AppContext.BaseDirectory` for `GitConverter.ConsoleApp*.dll` / `.exe`. 4. Walk upward to locate typical project `bin` output folders. If Program type is not found the test will throw an informative error listing probed locations. ## Test data - Integration tests that run conversions expect sample files under `TestData\`. - Files should be copied to test output (set `CopyToOutputDirectory=PreserveNewest`). ## Running tests - In IDE: run tests as usual — ensure ConsoleApp is built. - CLI: dotnet test ./GitConverter.TestsApp/GitConverter.TestsApp.csproj ## Captured output - The tests capture Console.Out and Console.Error to assert on user-facing messages and to include diagnostics when tests fail. - For end-to-end conversion tests the captured output is required to contain diagnostics when Program.Run returns non-zero. ## Debugging - To reproduce a failing scenario locally, run the ConsoleApp with equivalent CLI arguments printed by the failing test. - Use the `GITCONVERTER_DEBUG_TARGET` environment variable (Debug builds) to avoid typing long CLI arguments when debugging developer scenarios. ## Notes - These tests are best-effort and skip scenarios when required sample files are not present. - They are intended as integration/acceptance tests and may be slower than unit tests; keep sample artifacts small.