示例#1
0
        public void Delete_Test()
        {
            // Arrange
            var mockService = new Mock <IAppointmentEmployeeService>();
            var controller  = new AppointmentEmployeeController(mockService.Object);

            // Act
            IHttpActionResult actionResult = controller.Delete(1, 1, 1);

            // Assert
            Assert.IsInstanceOfType(actionResult, typeof(OkResult));
        }
示例#2
0
        public void Post_Test()
        {
            // Arrange
            var mockService = new Mock <IAppointmentEmployeeService>();
            var controller  = new AppointmentEmployeeController(mockService.Object);

            // Act
            IHttpActionResult actionResult = controller.Post(1, 1, 1);
            var createdResult = actionResult as OkNegotiatedContentResult <int>;

            // Assert
            Assert.IsNotNull(createdResult);
            Assert.IsTrue(createdResult.Content >= 0);
        }