public void ShouldDisplayIndex()
        {
            // Arrange
            SearchController controller = new SearchController(null);

            // Act
            ViewResult result = controller.Index();

            // Assert
            Assert.AreEqual("", result.ViewName);
            SearchViewData vd = result.ViewData.Model as SearchViewData;
            Assert.AreNotEqual(null, vd);
            Assert.AreEqual(false, vd.DisplaySearch);
        }
        public void ShouldRedirectFromSearchPost()
        {
            // Arrange
            Mock<ISearchResults> results = new Mock<ISearchResults>();
            Mock<IArtistsRepository> repository = new Mock<IArtistsRepository>();
            repository.Setup(r => r.Search(It.IsAny<string>())).Returns(results.Object);

            SearchController controller = new SearchController(repository.Object);

            // Act
            RedirectToRouteResult result = controller.Index("Pop") as RedirectToRouteResult;

            // Assert
            Assert.AreEqual("Results", (string)result.RouteValues["action"]);
            SearchViewData svd = controller.ViewData.Model as SearchViewData;
            Assert.AreNotEqual(null, svd);
            Assert.AreEqual(results.Object, svd.Results);
        }