user1181942
user1181942

Reputation: 1607

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.

Upvotes: 5

Views: 746

Answers (1)

Oscar Mederos
Oscar Mederos

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

Related Questions