Exemplo n.º 1
0
        public void TestControllerReturnsCorrectTestIndex()
        {
            //Act
            var controller = new TestsController(mockContext.Object);
            var TestResult = controller.Index() as ViewResult;
            var model      = (List <Test>)TestResult.ViewData.Model;

            //Assert
            Assert.AreEqual(test, model.FirstOrDefault(c => c.Test_Name == "Начално ниво"));
        }
Exemplo n.º 2
0
        public void IndexTestWithId()
        {
            // Arrange
            TestsController controller = new TestsController();

            // Act
            string     id     = "testtwo";
            ViewResult result = controller.Index(id) as ViewResult;

            // Assert
            Assert.IsNotNull(result);
        }