コード例 #1
0
        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 }
            });
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }