views:

27

answers:

1

Usually when you add one (in Visual Basic), it pops up a message asking if you want to enable an option that lets the test access things like private methods etc.

However, I am editing a solution that does not have this enabled. I'd like to enable it so my unit tests will work, but I can't find the setting.

Can anyone tell me how to enable it after the project has been created?

+3  A: 

In short you need the InternalsVisibleToAttribute

However, I would strongly argue against testing private members in your unit tests. You want to test behavior and not implementation details. If you test implementation details then your tests will become brittle and refactoring will be hard.

Josh
Thanks for the answer and advice :)
SLC
+1 for the advice. The answer might be correct, I don't know but the advice is what OP should take away from this.
Lieven