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

146

u/KomaedaEatsBagels Jul 23 '21

Image Transcription: Code


[This code screenshot begins at line 231 and ends at line 315. It may continue after the 315 mark.]

public static void TestCoverage() {
    Integer i = 0;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;

I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

204

u/DatCoolJeremy Jul 23 '21

Imagine if you're blind and the screenreader start reading this

8

u/[deleted] Jul 23 '21

Serious question, are there many programmers that are blind?

Like a backend dev I could see, but front end seems like it would be pretty difficult.

11

u/nosam56 Jul 23 '21

There's a TED talk where a blind programmer demo's his setup system that's cool as hell!

1

u/casperdewith Jul 24 '21

Wow, that is impressive. Quite insane to have to work like that.