Testing private methods using RhinoMocks

I work in a TDD environment, and basically I am faced with a dilemma, which I think is very important in a TDD environment. As a programmer, you want your methods to be as readable as possible. To do this, we tend to split our methods into several private methods. At the same time, all the code that was ported to a private function loses the ability to test.

The Rhino testing class cannot see all these private methods, and I also need to be able to run tests on these methods. I do not want them to be public, because it makes no sense to publish them.

Any ideas?

+4
source share
2 answers

If I ask part of your question:

[...] [...]

. , . , , , . , ?

, , . , - , InternalsVisibleTo.

( . ) - , . , . , . , .

+8

, - InternalsVisibleTo. .

, . , , , , . , , . , .

- , , .

+3

All Articles