GIS Converter -Console App -Tests Coverage

Dani_S 5,131 Reputation points
2025-12-17T08:19:14.6666667+00:00

Hi Michel,

Thank you very much for your help !!!

I implemented all your remarks from ticket:

https://learn.microsoft.com/en-us/answers/questions/5658212/gis-cli-commands

1.Can you please look if I added all the tests, if not please add me the needed files wit code?

2.Files

Program code:

Program.txt

GitConverter ConsoleApp README.txt

Programs tests:

ProgramIntegrationTests.txt

ProgramTests.txt

GitConverter.TestsApp.ConsoleApp.txt

Thanks in advance,

Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
0 comments No comments
{count} votes

Answer accepted by question author
  1. Michael Le (WICLOUD CORPORATION) 7,020 Reputation points Microsoft External Staff Moderator
    2025-12-18T09:43:29.33+00:00

    Hello @Dani_S ,

    You've done a solid job covering the basic scenarios, but there are some gaps in your test coverage.

    • Your current tests don't verify the SetLogger method at all. You need to test scenarios like invalid log paths, missing directories, case-insensitive log levels, and what happens when logging initialization fails.
    • You need comprehensive tests for malformed arguments, empty strings, special characters, and boundary conditions.
    • You test some exit codes but not all paths systematically.
    • Your integration tests only check whether files exist, not whether they contain valid data.

    I have created some tests to illustrate. Use them as references to expand your own test suite.

    LoggingTests.cs.txt

    ArgumentParsingTests.cs.txt

    ExitCodeTests.cs.txt

    OutputValidationTests.cs.txt

    Happy holidays.

    You and 1 other person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2025-12-17T08:19:32.8966667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To ensure that your GIS Converter Console App has adequate test coverage, you can utilize code coverage tools available in .NET. Here are some steps and tools you can consider:

    1. Use Code Coverage Tools: .NET includes a built-in code coverage data collector that generates a binary .coverage file. You can use this file to create reports in Visual Studio. Additionally, you can use the dotnet-coverage tool to convert the binary coverage results to a human-readable format.
    2. Coverlet: This is an open-source alternative that generates test results as human-readable Cobertura XML files. Ensure your unit test project has the appropriate package dependencies to use Coverlet.
    3. Viewing Coverage Results: You can view the coverage results in the Code Coverage Results window in Visual Studio. This window allows you to see which parts of your code are covered by tests and can help identify any missing tests.
    4. Merging Results: If you have multiple test runs, you can merge the results to get a comprehensive view of your test coverage.
    5. Exporting Results: You can export the coverage results to XML format for easier sharing and analysis.

    By following these practices, you can assess whether you have added all necessary tests and identify any areas that may require additional testing.

    You found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.