3.4. Implementing the Pizza Store

The following section will describe how to develop and write unit tests for the ASP.NET MVC application called the Wrox Pizza Store. The concept for the store is simple: a user should be able to navigate to the store, select items from a menu, pay for their purchases, and then expect delivery of their ordered products.

3.4.1. Downloading and Installing ASP.NET MVC

ASP.NET MVC is a free download available from http://www.asp.net/mvc/. The installation is a MSI package that contains a collection of assemblies relating to the core framework itself, JavaScript files including JQuery and Microsoft Ajax, and a set of Visual Studio templates to help you create ASP.NET MVC applications.

3.4.2. Structuring Your ASP.NET MVC Applications

The initial structure of your application is important in terms of how maintainable the system will be at the end. If you start off with a good structure it provides a firm foundation for you to build upon.

After downloading and installing ASP.NET MVC, you will have a set of Web Templates within Visual Studio in the same way you had templates for ASP.NET WebForms. By using these templates you can create an ASP.NET application by simply entering a name, in this example HelloWorldMVC; the template will create the structure, and add correct references and initial code to help you get started. After creating and executing the application, it should look similar to Figure 3-2.

Figure 3-2. The website generated by the MVC template ...

Get Testing ASP.NET Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.