Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Boy, that's a pretty general question. I'll do my best, but be prepared to see me miss by a mile.</p> <p>Assumptions</p> <ol> <li>You are using ASP.NET, not plain ASP</li> <li>You don't really want to test your web pages, but the <strong>logic</strong> behind them. Unit testing the actual .ASPX pages is rather painful, but there are frameworks out there to do it. <a href="http://nunitasp.sourceforge.net/" rel="noreferrer">NUnitAsp</a> is one.</li> </ol> <p>The first thing to do is to organize (or plan) your code so that it can be tested. The two most popular design patterns for this at the time seem to be MVP and MVC. Both separate the <strong>logic</strong> of the application away from the <strong>view</strong> so that you can test the logic without the view (web pages) getting in your way.</p> <p>Either MVP or MVC will be effective. MVC has the advantage of having a Microsoft framework <a href="http://www.asp.net/mvc/" rel="noreferrer">almost ready to go</a>. </p> <p>Once you've selected a framework pattern that encourages testability, you need to use a unit testing tool. <a href="http://www.nunit.org/" rel="noreferrer">NUnit</a> is a good starting point. Visual Studio Professional has a <a href="http://msdn.microsoft.com/en-us/library/bb385902.aspx" rel="noreferrer">testing suite built it</a>, but NUnit + <a href="http://www.testdriven.net/" rel="noreferrer">TestDrive.NET</a> also works in the IDE.</p> <p>That's sort of a shotgun blast of information. I hope some if it hits. The Pragmatic Bookshelf has a <a href="http://rads.stackoverflow.com/amzn/click/0974514020" rel="noreferrer">good book covering the topic</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload