Reputation: 1607
I am creating one web application which has structure as shown in following image:
I have all entities and datastore files in the App_Code
folder. i.e no separate project layer is created. I want to use Nunit for unit testing. But as for NUnit testing I need projectname.dll
and my web application will not create dll I don't know how to test my methods.
If I create a separate project for unit tests, I can not reference datastore and other files in that project. Kindly suggest how can I use Nunit in this case.
Upvotes: 5
Views: 746
Reputation: 29863
Please, check this: Unit Testing ASP.net Web Site Project code stored in App_Code.
You can also create another project, just for unit testing purposes. When you create it, just include all the required files (in App_Code
) As a Link. That way you will be creating shortcuts, so if you modify one file in your project, the other project you created will reflect the changes.
Upvotes: 4