NUnit and private methods

  • Thread starter Thread starter julien
  • Start date Start date
J

julien

Hello,
I wonder how people test private methods with NUnit: is it a good idea
to have a special build with all methods made public? Is there a better way?

I you make a special build for NUnit, what tool do you use?

Thank you
Julien
 
You could write your tests inside of your code. But then make sure you
compile this conditionally -- just so that the test code does not go into
production.
 
julien said:
Hello,
I wonder how people test private methods with NUnit: is it a good
idea to have a special build with all methods made public? Is there a
better way?

I usually avoid testing private methods. If I feel it's worth testing
class innards, I "promote" the affected methods to internal.

Cheers,
 
Back
Top