views:

28

answers:

1

Hi all, I have an project which is dependent on the another project. But now i want to create an unit test target for the main project. Is it possible? because it will be referring the files of its dependent project.

+1  A: 

To be able to test your individual components in isolation, you need your components be loosely coupled, talking with each other only via interfaces, where possible. And you need a good architecture that regularly uses Inversion Of Control/*Dependency Injection* patterns everywhere. Then replacing single components with mocks or stubs or whatever is of course possible.

If you don't have such an architecture ('design for testability'), then you likely will run into problems when testing...

HTH.

Thomas Weller