Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Nunit without creating separate project

I am creating one web application which has structure as shown in following image:

Structure

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.

like image 912
user1181942 Avatar asked Oct 05 '22 19:10

user1181942


1 Answers

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.

like image 108
Oscar Mederos Avatar answered Oct 13 '22 10:10

Oscar Mederos