public void Delete_Test() { // Arrange var mockService = new Mock <IAppointmentHitchayvutService>(); var controller = new AppointmentHitchayvutController(mockService.Object); int appointmentId = 1; int hitchayvutId = 1; int userId = 1; // Act IHttpActionResult actionResult = controller.Delete(appointmentId, hitchayvutId, userId); // Assert Assert.IsInstanceOfType(actionResult, typeof(OkResult)); }
public void Post_Test() { // Arrange var mockService = new Mock <IAppointmentHitchayvutService>(); var controller = new AppointmentHitchayvutController(mockService.Object); int appointmentId = 1; int hitchayvutId = 1; int userId = 1; // Act IHttpActionResult actionResult = controller.Post(appointmentId, hitchayvutId, userId); var createdResult = actionResult as OkNegotiatedContentResult <int>; // Assert Assert.IsNotNull(createdResult); Assert.IsTrue(createdResult.Content >= 0); }