Exemple #1
0
        public void EditPost_ReturnsActionResult_valid()
        {
            //Arrange
            var repo       = new Mock <IRepository <Technician> >();
            var controller = new TechnicianController(repo.Object);
            int test       = 1;

            //Act
            var result = controller.Edit(test);

            Assert.IsType <ViewResult>(result);
        }
Exemple #2
0
        public void Edit_Returns_ViewResult()
        {
            //Arrange
            var repo       = new Mock <IRepository <Technician> >();
            var controller = new TechnicianController(repo.Object);
            int id         = 1;

            //Act
            var result = controller.Edit(id);

            //Assert
            Assert.IsType <ViewResult>(result);
        }
Exemple #3
0
        public void EditPost_ReturnsViewResult_Invalid()
        {
            //Arrange
            var repo       = new Mock <IRepository <Technician> >();
            var controller = new TechnicianController(repo.Object);

            controller.ModelState.AddModelError("", "TestError");
            int test = 1;

            //Act
            var result = controller.Edit(test);

            Assert.IsType <ViewResult>(result);
        }