February 2010
Beginner
400 pages
11h 13m
English
Of course, one of the biggest advantages of MVC is its testability, and no overview of ASP.NET MVC would be complete without looking at this functionality. Note that this functionality is not available in all versions of Visual Studio. An alternative is to use an open source framework such as NUnit (which is arguably much better supported and documented, anyway).
To avoid accessing the database, you will create a fake class to return films:
Create a new folder in the project called Support.
Add a new class called FakeFilmRepository.
Replace the code in FakeFilmRepository.cs with the following:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using Chapter13.BobsMoviesMVC.Models; ...