Unit Testing app_code directory with Visual Studio Professional 2005

J

jd1978

I don't have Team System, but I'd like to be able to unit test the code
in my app_code directory using nunit, or something else. Is there any
way to do this? I can't add a reference from another page, and I can't
find the dll for these classes. Thoughts?

Thanks.
-jeff
 
S

Scott Allen

I don't have Team System, but I'd like to be able to unit test the code
in my app_code directory using nunit, or something else. Is there any
way to do this? I can't add a reference from another page, and I can't
find the dll for these classes. Thoughts?

Without using a class library project, I think you'd almost have to
put unit tests inside App_Code then use MSBuild to precompile the
application into a known directory and run NUnit against App_Code*
assemblies.

Another option is to use WDP [1], which is a collection of custom
MSBuild tasks for ASP.NET. You can precompile and merge all the
dynamic assemblies into a single .dll. Your NUnit project can
establish a project reference to the WDP project, so the unit tests
can live in a different assembly (which is preferable, IMHO).


[1]
http://msdn.microsoft.com/asp.net/reference/infrastructure/wdp/default.aspx
 
J

jd1978

Thank you Scott, I think I'll go the separate project route. I just
thought I'd see if there was a simple other option. Appreciate the
input.
-Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top