public void GetLocations_CallsApiWithRightParameters() { mockers.SetupAnyExecution <ApiResponse <List <Location> > >(); try { GetLocations(); } catch (Exception) { // ignored } mockers.VerifyExecution <ApiResponse <List <Location> > >( BaseUrl, "v1/locations", Method.GET, expectedHeaders: new Dictionary <string, object> { { CorrelationIdHeader, Context.Correlation } }); }
public void Checkout_IfBookingIsSet_CallsApiWithRightParameters(BookingParameters parameters, string requestBody) { mockers.SetupAnyExecution <ApiResponse <PaymentInfo> >(); try { Checkout(parameters); } catch { // ignored } mockers.VerifyExecution <ApiResponse <PaymentInfo> >( BaseUrl, $"v{ApiVersion}/checkout", Method.POST, bodyInJson: requestBody, expectedHeaders: null, expectedQueryParameters: null); }
public void Authenticate_CallsApiWithRightParameters(ApiContext context, string expectedRequestBody) { Context = context; mockers.SetupAnyExecution <AccessToken>(); try { var actual = Authenticate(); } catch (Exception) { // ignored } mockers.VerifyExecution <AccessToken>(BaseUrl, Endpoint, Method.POST, bodyInJson: expectedRequestBody); }