/// <summary> /// Send a GET to the specified URI using a test server and configuration created just for this call. /// </summary> /// <param name="call">Details the requirements of the call to be made.</param> public static async Task <CallResponse> InvokeIsolatedGetAsync(CallRequirements call) { using (var tester = new ApiIntegrationTester()) { return(await tester.InvokeGetAsync(call)); } }
private HttpClient GetClient(CallRequirements call) { var client = TestServer.HttpClient; client.Timeout = call.TimeOut; return(client); }
private async Task FetchInitialResponseAsync(CallRequirements call, CallResponse response) { EnsureStarted(); ClearDownForNewTest(); await MakeCall(call, response); SaveCallDetails(response); }
private async Task <CallResponse> GetResponseAsync(CallRequirements call) { var callResponse = new CallResponse(); await FetchInitialResponseAsync(call, callResponse); return(callResponse); }
private async Task <CallResponse <TResult> > GetResponseAsync <TResult>(CallRequirements call) { var callResponse = new CallResponse <TResult>(); await FetchInitialResponseAsync(call, callResponse); await FetchCompleteResponseAsync(callResponse); return(callResponse); }
public Task <CallResponse <TResult> > InvokeGetAsync <TResult>(CallRequirements call) { EnsureStarted(); return(GetResponseAsync <TResult>(call)); }
public Task <CallResponse> InvokeGetAsync(CallRequirements call) { return(GetResponseAsync(call)); }
public static async Task <CallResponse <TResult> > InvokeIsolatedGetAsync <TResult>(CallRequirements call) { using (var tester = new ApiIntegrationTester(TestSetupIoC.CreateIoC)) { return(await tester.InvokeGetAsync <TResult>(call)); } }
private async Task MakeCall(CallRequirements call, CallResponse response) { var client = GetClient(call); response.Response = await client.GetAsync(call.Uri); }