public async Task <ActionResult <Guid> > Create([FromBody] CreateJobOrderCommand command) { var request = new ContextualRequest <CreateJobOrderCommand, Guid> (command, "userId"); var JobOrderId = await Mediator.Send(request); return(Ok(JobOrderId)); }
public async Task GivenCreateJobOrderCommand_ReturnsNewJobOrderId() { var command = new CreateJobOrderCommand { CompanyName = "Coffee", ContactName = "Bibo", Address = "Address" }; var content = Utilities.GetRequestContent(command); var response = await _client.PostAsync($"/api/joborders/create", content); response.EnsureSuccessStatusCode(); var jobOrderId = await Utilities.GetResponseContent <int>(response); Assert.NotEqual(0, jobOrderId); }