public void CreateTechnician(Technician tech, List <Service> skills)
        {
            techCtr.Create(tech);

            foreach (Service i in skills)
            {
                techCtr.Add(i, tech);
            }
        }
Ejemplo n.º 2
0
        public void Technician_Create_Default_Should_Pass()
        {
            // Arrange
            var myController = new TechnicianController();

            // Act
            var result = myController.Create();

            // Assert
            Assert.IsNotNull(result);
        }
Ejemplo n.º 3
0
        public void Technician_Create_Post_Default_Should_Pass()
        {
            // Arrange
            var myController = new TechnicianController();
            var myData       = new TechnicianModel();

            // Act
            var result = myController.Create(myData);

            // Reset

            // Assert
            Assert.IsNotNull(result);
        }
Ejemplo n.º 4
0
        public void Technician_Create_Post_Invalid_Model_Should_Send_Back_For_Edit()
        {
            // Arrange
            var controller = new TechnicianController();
            var data       = new TechnicianModel();

            // Make ModelState Invalid
            controller.ModelState.AddModelError("test", "test");

            // Act
            var result = controller.Create(data) as RedirectToActionResult;

            // Assert
            Assert.AreEqual("Error", result.ActionName);
        }