NUnit and private methods

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
 
M

Manohar Kamath

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.
 
J

Joerg Jooss

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top