private async Task <IActionResult> Put(string version, Guid id, string textToMatch) { var request = new ProcessMessageRequest(id, textToMatch); var response = await mediator.Send(request); logger.LogInformation("Processed Put {version} with result '{description}'.", version, response.Description); return(MessageProcessResponse((dynamic)response)); }
private async Task use_processing_service_on_put(string version, string matchingWord) { var givenRequest = new ProcessMessageRequest(SomeId, matchingWord); factory.ProcessMessageHandler .Handle(Arg.Any <ProcessMessageRequest>(), Arg.Any <CancellationToken>()) .Returns(new ProcessMessageResponse(AnyDescription)); client.DefaultRequestHeaders.Add("X-version", version); var response = await client.PutAsync($"/messages/process/{SomeId}", null); response.EnsureSuccessStatusCode(); await factory.ProcessMessageHandler.Received() .Handle(Arg.Is <ProcessMessageRequest>( r => r.MessageId == givenRequest.MessageId && r.TextToMatch == givenRequest.TextToMatch), Arg.Any <CancellationToken>()); }