public void CreateVisitTest() { // Arrange var controller = new VisitController(); var model = new VisitViewModel(); // Act var result = controller.CreateVisit(model); // Assert Assert.AreEqual("closeModal('visit-modal')", result.Data); }
public void InvalidModelStateTest() { // Arrange var controller = new VisitController(); var model = new VisitViewModel { Id = 4, ParentVisitId = 1 }; controller.ModelState.AddModelError("Name", new Exception("Test error")); // Act var result = controller.CreateVisit(model); // Assert Assert.AreEqual("error", result.Data); }