Creating the unit test for an ASP.NET web site or application is similar to the one we created for the normal class library. The ASP.NET unit test is used for testing the methods or the business logic used for the ASP.NET site. The only difference is the additional attributes added to the methods to identify the URL and the Host. The ASP.NET unit test can be run using IIS web server or the development web server. If it is on the IIS server we can choose the user identity with which the unit test should run. The default identity depends on the version of the IIS server and the operating system.
Let us consider a simple user registration page created using ASP.NET using Visual Studio 2008. Below is the UI for the user to get registered.
This web application runs on the local development server. The application has two methods. One is to get the user details from the user interface and create a new user object and the other is to just display the user name...