I have been doing some serious unit testing with c’# Some of the classes I have designed are internal, that is, they cannot be accessed from outside the name space.
If anyone is used to unit testing you know you want to test those classes too, to do so you can use to different techniques:
- Use tests inside the project and enclose them inside conditional compilation arguments
- Use a separate test project and “link“ to the actual source files you want to use
- Right click on project
- Add Existing item
- in the browse dialog, highlight the file in the tested project
- open the small menu on the ‘Open“ button
- select “Link file“
- Note: this only works for classes that have dependencies that are shared between the test and the tested project so it might get a bit too much work if you have large dependencies in your class files.