public void BoardControllerEnsureIndexViewExists() { // Arrange BoardController controller = new BoardController(); // Act ViewResult result = controller.Index() as ViewResult; // Assert Assert.AreEqual("Index", result.ViewName); }
public void BoardControllerEnsureIndexPageExists() { // Arrange BoardController controller = new BoardController(); // Act ViewResult result = controller.Index() as ViewResult; // Assert Assert.IsNotNull(result); }
public void BoardControllerEnsureItHasThings() { // Arrange BoardController controller = new BoardController(); // Act ViewResult result = controller.Index() as ViewResult; // Assert string expected_message = "My Boards"; Assert.AreEqual(expected_message, result.ViewBag.Message); }
public void BoardControllerEnsureListOfUserBoards() { // Arrange List<Board> data_store_boards = new List<Board> { new Board {Title = "My Awesome Board", BoardId = 1, Owner = owner }, new Board {Title = "My Grocery Board", BoardId = 2, Owner = owner } }; BoardController controller = new BoardController(mock_repository.Object); mock_repository.Setup(r => r.GetAllBoards()).Returns(data_store_boards); // Act ViewResult result = controller.Index() as ViewResult; // Assert CollectionAssert.AreEqual(data_store_boards, result.ViewBag.Boards); }