-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New article that details unit test code coverage using coverlet #18955
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <tdykstra@microsoft.com>
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no line breaks, just &&
and cd
commands. Both of which are cross platform.
Co-authored-by: Tom Dykstra <tdykstra@microsoft.com>
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