title: How to implement unit tests in a database-backed ASP.NET application (also UI testing)
body: <p>ASP.NET apps that I've developed (on ASP.NET 2.0) have typically been backed by a database; the great majority of the .NET code on the server loads data in the form of a <code>DataSet</code> or <code>SqlDataReader</code> and uses it to databind something like a <code>DataGrid</code>.  The meaningful logic is either database dependent or user interface dependent.</p>
  
  <p>In this context, how should I implement unit tests that would be run by a continuous integration server (probably CruiseControl.NET)?  Should I set up a test database connection for it to use to test CRUD operations and more complex SPROCs, or should more logic be contained in the .NET code and not in a SPROC?  This becomes more complex when there is structure in the database that the application expects to find (such as a Users table in something I'm writing for a CMS).</p>
  
  <p>Also, what are the best ways to do unit-testing of user interfaces?  I've found <a href="http://nunitasp.sourceforge.net/" rel="nofollow">NUnitASP</a>, which is now abandoned but mentions <a href="http://seleniumhq.org/" rel="nofollow">Selenium</a> and <a href="http://watir.com/" rel="nofollow">Watir</a>.</p>