public void ShouldDisplayDetails()
        {
            // Arrange
            const int id = 1;
            Person person = new Person {Id = 1, FirstName = "TestFirstName1", LastName = "TestLastName1"};

            var repositoryMock = new Mock<IRepository>();
            repositoryMock.Setup(r => r.GetById<Person>(id)).Returns(person).Verifiable("GetById was not called with the correct Id");
            // Note: using Verifiable() is not considered best practice - see http://code.google.com/p/moq/issues/detail?id=220
            //      use .Verify() instead

            PersonController controller = new PersonController(repositoryMock.Object);

            // Act
            ViewResult result = controller.Details(id);

            // Assert
            repositoryMock.Verify();
            repositoryMock.Verify(r => r.GetById<Person>(id), Times.Exactly(1));

            Assert.IsNotNull(result);

            // check the view data
            Assert.IsNotNull(result.ViewData["GenderList"]);
            Assert.IsTrue(result.ViewData["GenderList"].GetType() == typeof(Dictionary<string, string>));
            Assert.IsTrue(((Dictionary<string, string>)result.ViewData["GenderList"]).ContainsKey("M"));

            // check the Model
            Assert.IsNotNull(result.Model);
            Assert.AreEqual(person, result.Model);
        }