public void Delete_ServiceRequest_Return_NotFound() { using (var context = new ServiceRequestContext()) { ServiceRequest sr = GetServiceRequest(); var controller = new ServiceRequestController(context); sr.id = new Guid("dadd45b9-d13d-4fd1-9f29-514aa8459e0d"); var contentStatus = (NotFoundResult)controller.DeleteServiceRequest(sr.id).Result.Result; Assert.NotNull(contentStatus); Assert.Equal(404, contentStatus.StatusCode); } }
public void Delete_ServiceRequest_Request_Is_Deleted() { using (var context = new ServiceRequestContext()) { ServiceRequest sr = GetServiceRequest(); var controller = new ServiceRequestController(context); _ = controller.PostServiceRequest(sr); var result = controller.DeleteServiceRequest(sr.id); var deletedItem = controller.GetServiceRequest(sr.id); Assert.NotNull(result); Assert.Equal(sr, result.Result.Value); Assert.Null(deletedItem.Result.Value); } }