How to unit test private methods in BDD / TDD?
- by robert_d
I am trying to program according to Behavior Driven Development,
which states that no line of code should be written without writing
failing unit test first.
My question is, how to use BDD with private methods?
How can I unit test private methods?
Is there better solution than:
- making private methods public first and then making them private
when I write public method that uses those private methods;
or
- in C# making all private methods internal and using InternalsVisibleTo
attribute.
Robert