public void Put_ServiceRequest_Return_BadRequest_For_Id() { using (var context = new ServiceRequestContext()) { ServiceRequest sr = GetServiceRequest(); sr.currentStatus = "InProgress"; var controller = new ServiceRequestController(context); var contentStatus = (BadRequestObjectResult)controller.PutServiceRequest(new Guid("dadd45b9-d13d-4fd1-9f29-514aa8459e0d"), sr).Result; Assert.NotNull(contentStatus); Assert.Equal(400, contentStatus.StatusCode); } }
public void Put_ServiceRequest_Return_BadRequest_For_CurrentStatus() { using (var context = new ServiceRequestContext()) { ServiceRequest sr = GetServiceRequest(); sr.currentStatus = "Invalid code"; var controller = new ServiceRequestController(context); var contentStatus = (BadRequestObjectResult)controller.PutServiceRequest(sr.id, sr).Result; Assert.NotNull(contentStatus); Assert.Equal(400, contentStatus.StatusCode); } }
public void Put_ServiceRequest_Return_ServiceRequest() { using (var context = new ServiceRequestContext()) { ServiceRequest sr = GetServiceRequest(); sr.currentStatus = "InProgress"; var controller = new ServiceRequestController(context); _ = controller.PutServiceRequest(sr.id, sr); var result = controller.GetServiceRequest(sr.id); Assert.NotNull(result); Assert.Equal(sr, result.Result.Value); } }