Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should internal classes and methods be tested? [duplicate]

Possible Duplicate:
testing an internal class

I like to have my test classes in a separate assembly, and that is causing some problem with testing internal classes. Since internal classes and methods are only visible inside of the assembly my test assembly can't see those classes and methods. What is the most effective way to test those classes? Do I need to use reflection to access the methods I wan't to test?

like image 405
Tomas Jansson Avatar asked May 30 '26 08:05

Tomas Jansson


1 Answers

You can use the InternalsVisbleTo attribute.

See this question: How do I allow assembly (unit testing one) to access internal properties of another assembly?

like image 194
Razzie Avatar answered May 31 '26 22:05

Razzie