Why are these lines not covered by code coverage?

I use the Visual Studio 2010 code coverage feature. I did some unit tests to test the method, but code coverage tells me that the three blocks are not completely covered. The problem is that I don’t see how these blocks can be partially covered. Note that the reverse ARE expressions are covered, so the branch was clearly drawn. Any ideas?

enter image description here

+4
source share
1 answer

The answer turned out to be so that endDate is NULL. Despite the fact that I handle null cases from above, the code coverage wanted to see a delt zero situation with each branch with endDate in it.

+4
source

Source: https://habr.com/ru/post/1402457/


All Articles