public void Delete_Test() { // Arrange var mockService = new Mock <IAppointmentTestEmployeeService>(); var controller = new AppointmentTestEmployeeController(mockService.Object); int appointmentTestId = 1; int employeeId = 1; int userId = 1; // Act IHttpActionResult actionResult = controller.Delete(appointmentTestId, employeeId, userId); // Assert Assert.IsInstanceOfType(actionResult, typeof(OkResult)); }
public void Post_Test() { // Arrange var mockService = new Mock <IAppointmentTestEmployeeService>(); var controller = new AppointmentTestEmployeeController(mockService.Object); string employeeName = "name"; int employeeId = 1; int appointmentTestId = 1; int userId = 1; // Act IHttpActionResult actionResult = controller.Post(appointmentTestId, employeeId, employeeName, userId); var createdResult = actionResult as OkNegotiatedContentResult <int>; // Assert Assert.IsNotNull(createdResult); Assert.IsTrue(createdResult.Content >= 0); }