Posts

Showing posts with the label coverlet

Tests code coverage in Visual Studio Code with C# and .Net Core

Image
While writing tests for you code goes without saying, there is much to be said about code coverage of tests. How much of your code is actually covered by these tens of tests you just wrote? If you work in a TDD approach most probably you don't have such "mundane" questions. Of course you code is 100% covered. You did make sure every test failed before you added that line in your code to make it pass... and that conditional statement... or did you? While purists would argue there is no chance of no coverage I beg to differ. Let alone if you write your tests after the code is written... After such and such years and experience in the industry when we are nearing deadlines some things are thrown out the window. They shouldn't but they are. TL;DR tools help with coverage. In this case .Net Core Test Explorer with coverlet and Coverage Gutters . Photo by  Startup Stock Photos  from  Pexels Coverlet to the rescue As I blogged a while ago I have made myself a warm