public void TestController() { // Arrange BandsController controller = new BandsController(); // Act ViewResult result = controller.Index() as ViewResult; // Assert Assert.IsNotNull(result); }
public void Index_HasCorrectModelType_BandList() { //Arrange ViewResult indexView = new BandsController().Index() as ViewResult; //Act var result = indexView.ViewData.Model; //Assert Assert.IsTrue(result.GetType() == typeof(List <Band>)); Assert.IsInstanceOfType(result, typeof(List <Band>)); }