public void ItShouldReturnCorrectView() { var recipeList = new List <Recipe> { new Recipe { Id = 1, Title = "recipe1" }, new Recipe { Id = 2, Title = "recipe2" }, new Recipe { Id = 3, Title = "recipe3" } }; _recipeRepositoryMock.Setup(x => x.GetAll()).Returns(recipeList.AsQueryable); var result = _controller.RecipesList(2) as ViewResult; Assert.Equal("RecipesList", result.ViewName); }