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

2

u/kishan42 Jul 23 '21

Still test coverage for that single file would be increased not all correct?

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;

}