Closed neiesc closed 5 years ago
Hi @neiesc, Can you give me a few more details on what you are trying to achieve?
An example: I would like to get the value of AcceptedWarnings in Return, type:
var acceptedWarnings = 0;
var _stubTaskServerApiHttp = HttpMockRepository.At($"http://localhost:3000");
_stubTaskServerApiHttp.Stub(x => x.Post($"/task_server/tasks"))
.Return(() =>
{
acceptedWarnings = GetAcceptedWarnings();
return @"
{
'status_code': 0,
'message': 'Taks manager mocked by HttpMock, url /task_server/tasks',
'task_id': '10'
}";
})
.OK();
Post body is supported. See https://github.com/hibri/HttpMock/blob/master/src/HttpMock.Integration.Tests/HttpEndPointTests.cs#L61 Could you not construct the response body earlier?
Cool, thanks!
Could you not construct the response body earlier?
I think, so.
I tested it, LastRequest
is getting the first request and not the last one. Is this expected? @hibri
That's not what is expected. Sounds like a bug. Can you create a new issue with the failing test please?
Thanks
Can you create a new issue with the failing test please?
Of course.
Is it possible to get Body from the post or put method?