In MSTest, the [Shadowing]
attribute helps you to unit test a private method from another assembly. Here is the related link : What is the Shadowing attribute that the VS uses when it generates unit tests?
My questions are:
- Should private methods be unit tested separately?
- Is it a good (?) practice to change private method's accessor to
internal
just to make it available for unit testing in some other test project/assembly? (usingInternalsVisibleTo
) - If private methods get tested indirectly through the public method that calls them, can it be called "unit" testing?