New article that details unit test code coverage using coverlet#18955
New article that details unit test code coverage using coverlet#18955IEvangelist merged 17 commits intodotnet:masterfrom
Conversation
tdykstra
left a comment
There was a problem hiding this comment.
This looks great, I just had some suggestions to change wording here and there, include some guidance on choosing among alternatives, and include some output examples.
Co-authored-by: Tom Dykstra <[email protected]>
|
Ping @tdykstra and @BillWagner - I flipped this back over to "ready for review". I've made huge updates to it, since it was approved from Tom initially. |
|
I'll take another look this afternoon. |
tdykstra
left a comment
There was a problem hiding this comment.
Given the tutorial format, I wonder if a further structural change would be useful -- right now the directions have them doing 2 unit test projects and include partial instructions for a 3rd. As a tutorial, it might work better as 3 , that is, up front give the three options and tell how to choose, then have a separate sequence of instructions for each choice. That way they get to follow instructions fully covering their chosen approach while not having to do steps that pertain to an approach that is irrelevant for them.
| The *MSBuild* project is named appropriately, as it will depend on the [coverlet.msbuild](https://www.nuget.org/packages/coverlet.msbuild) NuGet package. Add this package dependency by running the [`dotnet add package`](../tools/dotnet-add-package.md) command: | ||
|
|
||
| ```dotnetcli | ||
| cd XUnit.Coverlet.MSBuild\ && dotnet add package coverlet.msbuild && cd .. |
There was a problem hiding this comment.
Does this method of including line breaks work equally well in PowerShell, CMD, on Linux, and on macOS? If not it might be better to create a separate block for each command.
There was a problem hiding this comment.
There are no line breaks, just && and cd commands. Both of which are cross platform.
Co-authored-by: Tom Dykstra <[email protected]>
Summary
Adding new article that details unit test code coverage using coverlet.
dotnet test --collect:"Data Collector"Fixes #1477, and fixes #17255
Preview
✔️ NEW: Use code coverage for unit testing
✔️ UPDATE: Unit testing best practices with .NET Core and .NET Standard