public void Index() { // Arrange Mock <User> userMock = new Mock <User>(); Mock <GameManager> managerMock = new Mock <GameManager>(userMock.Object); CommunicationController controller = new CommunicationController(managerMock.Object); // Act ActionResult result = controller.Index(); // Assert Assert.That(result, Is.TypeOf(typeof(RedirectToRouteResult)), "Should return a redirect"); Assert.That(controller.ModelState.IsValid, "No errors should be returned"); managerMock.Verify(); }
public void IndexTest() { var result = _controller.Index() as ViewResult; Assert.IsNotNull(result); }