-1

I want to unit test a webpage which is obviously outside the App_code folder.

What is the best way to do this?

djot
  • 2,952
  • 4
  • 19
  • 28
happygilmore
  • 3,008
  • 4
  • 23
  • 37

1 Answers1

0

It depends on what you are actually testing, there are test for HTML output, but maybe in ASP.Net MVC what you would like to test is the controllers. If you are testing data results, then your tests are performed even outside of the project. Testing aspx files are actually difficult to test because there are so many things intermingled that there is no one tool to test them all in single method.

Jorge Alvarado
  • 2,664
  • 22
  • 33
  • It's a good question, I guess I'm testing for data results. Btw I am not using MVC (work requirements) – happygilmore Feb 24 '13 at 11:37
  • 1
    ok, so this post might help you with that!, hope it helps http://stackoverflow.com/questions/260342/what-best-practices-do-you-use-for-testing-database-queries – Jorge Alvarado Feb 24 '13 at 11:45
  • Thanks. I read the link, if I understand this deals with the DB side, but is there any resources on ASP.NET side also? – happygilmore Feb 24 '13 at 11:54
  • yeah, you can always create mockups and testing classes, retrieving the data from queries and use NUNIT to see of your results come out as you expected. – Jorge Alvarado Feb 24 '13 at 11:55
  • I didn't think NUnit worked with ASP.NET websites (note: I am using plain website, not web application) – happygilmore Feb 24 '13 at 11:58
  • but you just said you are testing data results, in that case the only thing you have to test is either the HTML output or the queries. And if you are testing classes (ASP.Net or not) then you can use NUNIT – Jorge Alvarado Feb 24 '13 at 12:02
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/25037/discussion-between-happygilmore-and-jorge-alvarado) – happygilmore Feb 24 '13 at 12:03