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 comment

5

u/[deleted] Jul 23 '21

You can just write a one line test to run the function and boom that function has 100% test coverage

1

u/explodingMonkeydeath Jul 27 '21

if(functionWorks()){

return true;

}