Beispiel #1
0
        public void TestController()
        {
            // Arrange
            BandsController controller = new BandsController();
            // Act
            ViewResult result = controller.Index() as ViewResult;

            // Assert
            Assert.IsNotNull(result);
        }
Beispiel #2
0
        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>));
        }