public void CreateTechnician(Technician tech, List <Service> skills) { techCtr.Create(tech); foreach (Service i in skills) { techCtr.Add(i, tech); } }
public void Technician_Create_Default_Should_Pass() { // Arrange var myController = new TechnicianController(); // Act var result = myController.Create(); // Assert Assert.IsNotNull(result); }
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); }
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); }