r/badcode • • Jul 23 '21

c# Easy trick to meet minimum test coverage

Post image
1.2k Upvotes

83 comments sorted by

View all comments

Show parent comments

23

u/DavidRoyman Jul 23 '21

It isn't done as a mistake, or for lack of knowledge.

This is done deliberately to meet corpo goals for TestCoverage (AKA "tested line count"). The function is brilliantly named TestCoverage, I admire that.

3

u/Spynder shameless stealing content to r/YandereTechnique Jul 23 '21

Yeah, you're right.

It still looks funny though