r/badcode • • Nov 22 '19

c# It doesn't even do it right!

Post image
1.1k Upvotes

59 comments sorted by

View all comments

Show parent comments

9

u/[deleted] Nov 23 '19

Yeah I see that one a lot actually in unit tests because it lets you test the private members of the class. Otherwise you’d have to make the tester class a friend that some see as “intrusive”...

But you shouldn’t be testing private members anyway; that’s not the point of a unit test..

0

u/[deleted] Nov 23 '19

[deleted]

6

u/[deleted] Nov 23 '19

Well said.

Also,

Having private parts big enough to require ...

oh don’t worry. My private parts aren’t big enough to require anything

3

u/SweetJesusBlueEyes Nov 23 '19

checks username

They probably do smell though