Your
SendRequest
method returns a
Task<ResponseStatus>
. You can't test the value returned by that task until the task has completed.
The simplest solution is to make your calling method
async
, and
await
the task:
var result = await apiRequest.SendRequest(Method.Post, endpoint, body);
if (result == ResponseStatus.Error)
{
}