Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }