{"id":20081893,"url":"https://github.com/jke94/netcorecoverage","last_synced_at":"2025-07-03T03:05:38.318Z","repository":{"id":42454247,"uuid":"365543857","full_name":"jke94/NetCoreCoverage","owner":"jke94","description":"A .NET 5 solution example, to get metric coverage from the different project of the solution.","archived":false,"fork":false,"pushed_at":"2022-04-05T08:07:00.000Z","size":217,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-17T01:02:35.341Z","etag":null,"topics":["coverage","coverlet","csharp","net5","reportgenerator"],"latest_commit_sha":null,"homepage":"https://jke94.medium.com/code-coverage-in-net-core-840bcd96b1e9","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jke94.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-08T15:07:50.000Z","updated_at":"2021-05-09T15:10:21.000Z","dependencies_parsed_at":"2022-09-14T00:01:38.946Z","dependency_job_id":null,"html_url":"https://github.com/jke94/NetCoreCoverage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jke94/NetCoreCoverage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jke94%2FNetCoreCoverage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jke94%2FNetCoreCoverage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jke94%2FNetCoreCoverage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jke94%2FNetCoreCoverage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jke94","download_url":"https://codeload.github.com/jke94/NetCoreCoverage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jke94%2FNetCoreCoverage/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260382226,"owners_count":23000672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coverage","coverlet","csharp","net5","reportgenerator"],"created_at":"2024-11-13T15:40:45.665Z","updated_at":"2025-07-03T03:05:38.291Z","avatar_url":"https://github.com/jke94.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Code coverage in .NET 5 (C#)\nA .NET 5 solution example, to get metric coverage from the differents projects of the solution.\n# Medium Post\n[Code coverage in .NET 5 (C#)](https://jke94.medium.com/code-coverage-in-net-core-840bcd96b1e9)\n\n## Description\n\nIn this project has been used the following tools and NuGet Packages to extract the metric solutions:\n\n- [Coverlet](https://github.com/coverlet-coverage/coverlet)\n- [NUnit](https://github.com/nunit/nunit)\n- [ReportGenerator](https://github.com/danielpalme/ReportGenerator)\n\n## Getting Started\n\n### Dependencies or tool necessaries\n\n* Visual Studio Community 2019\n* .NET 5.0\n\n### Installing\n\n* Clone project.\n* Open NetCoreCoverage.sln\n\n\n### Steps (using dotnet command)\n\n#### 1. Build the solution in release target (from the base repository folder).\n\n```\n\u003edotnet build NetCoreCoverage.sln --configuration Release\n```\n\n#### 2. Run the unit tests from the solution in relase target (from the base repository folder) and generate results. This command will displayed in the command line the results of the coverage, and futhermore, this command will generate a file (.\\TestResults\\coverage.cobertura.xml)\n\n```\n\u003edotnet test NetCoreCoverage.sln --configuration Release /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:Exclude=\"[xunit*]\\*\" /p:CoverletOutput=\"../TestResults/\"\n\n```\n![dotnet test](https://github.com/jke94/NetCoreCoverage/blob/dev/Images/dotnetTestsRun.PNG)\n\n#### 3. Generate report coverage metrics in html format. This command consume the '.\\TestResults\\coverage.cobertura.xml' file and generate a output folder with a index.hmtl file to visualize the results in a browser.\n\n```\n\u003ereportgenerator \"-reports:TestResults\\coverage.cobertura.xml\" \"-targetdir:TestResults\\html\" -reporttypes:Html\n```\n![reportgenerator](https://github.com/jke94/NetCoreCoverage/blob/dev/Images/ReportGeneratorToolGenerateReport.PNG)\n\n#### 4. Visualize the results with in the browser.\n![reportgenerator](https://github.com/jke94/NetCoreCoverage/blob/dev/Images/ExampleOfReports.PNG)\n\n## Help\n\nAny advice for common problems or issues.\n\n\n## Authors\n\nJavier Carracedo \n\nTwitter Profile: [@JaviKarra94](https://twitter.com/JaviKarra94)\n\n## Version History\n\n\n## License\n\nThis project is licensed under the [Mit License](https://github.com/jke94/NetCoreCoverage/blob/dev/LICENSE), see the LICENSE.md file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjke94%2Fnetcorecoverage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjke94%2Fnetcorecoverage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjke94%2Fnetcorecoverage/lists"}