Hello @Dani_S ,
Your test expects the program to return exit code 1 (AppError) when no arguments are provided, but your Program.cs is actually returning 0 (Success). If you look at line 116 in your Program.cs:
if (args.Length == 0 || args[0] == "help" || args[0] == "--help" || args[0] == "-h")
{
ShowHelp();
return (int)ExitCode.Success; // Returns 0
}
The program returns ExitCode.Success when showing help, but your test at line 96 in ProgramTests.cs expects 1:
Assert.Equal(1, exit);
I'd recommend updating your test to expect 0 instead of 1:
[Fact(DisplayName = "No args prints help")]
public void Run_NoArgs_PrintsHelp()
{
var exit = InvokeRun(Array.Empty<string>());
var outText = _outWriter.ToString();
Assert.Contains("GIS Converter CLI Tool", outText, StringComparison. OrdinalIgnoreCase);
Assert.Contains("Usage", outText, StringComparison.OrdinalIgnoreCase);
// Help is a successful operation, should return 0
Assert.Equal(0, exit);
}
You'll also want to remove or update the comment in your test that says // Program.Run returns AppError (1) when showing help / no args since that's not actually what's happening.