From ff6fba5d6336ae0002b47cebbf56c5f9f3d0a2f9 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Fri, 23 Mar 2018 12:07:42 +0100 Subject: putting query with amounts under test. --- src/include/taler_merchant_testing_lib.h | 14 +++++++++++++ src/lib/test_merchant_api_new.c | 8 ++++++++ src/lib/testing_api_cmd_tip.c | 35 ++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/src/include/taler_merchant_testing_lib.h b/src/include/taler_merchant_testing_lib.h index 046fccb6..a242e6d8 100644 --- a/src/include/taler_merchant_testing_lib.h +++ b/src/include/taler_merchant_testing_lib.h @@ -520,6 +520,20 @@ TALER_TESTING_cmd_tip_query (const char *label, unsigned int http_status, const char *instance); +/** + * FIXME + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_tip_query_with_amounts + (const char *label, + const char *merchant_url, + struct GNUNET_CURL_Context *ctx, + unsigned int http_status, + const char *instance, + const char *expected_amount_picked_up, + const char *expected_amount_authorized, + const char *expected_amount_available); + /** * FIXME */ diff --git a/src/lib/test_merchant_api_new.c b/src/lib/test_merchant_api_new.c index a412fb66..2b8e75df 100644 --- a/src/lib/test_merchant_api_new.c +++ b/src/lib/test_merchant_api_new.c @@ -503,6 +503,14 @@ run (void *cls, MHD_HTTP_OK, "tip"), + TALER_TESTING_cmd_tip_query_with_amounts ("query-1", + merchant_url, + is->ctx, + MHD_HTTP_OK, + "tip", + "EUR:0.0", // picked + "EUR:10.02", // auth + "EUR:20.04"),// ava /* Will fail here until all new * transfers have not been checked. I.e., * there is now a 20.04 euro "pending" transfer. */ diff --git a/src/lib/testing_api_cmd_tip.c b/src/lib/testing_api_cmd_tip.c index 38a155b4..80722ba0 100644 --- a/src/lib/testing_api_cmd_tip.c +++ b/src/lib/testing_api_cmd_tip.c @@ -395,6 +395,41 @@ tip_query_run (void *cls, } +/** + * FIXME + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_tip_query_with_amounts + (const char *label, + const char *merchant_url, + struct GNUNET_CURL_Context *ctx, + unsigned int http_status, + const char *instance, + const char *expected_amount_picked_up, + const char *expected_amount_authorized, + const char *expected_amount_available) +{ + struct TipQueryState *tqs; + struct TALER_TESTING_Command cmd; + + tqs = GNUNET_new (struct TipQueryState); + tqs->merchant_url = merchant_url; + tqs->ctx = ctx; + tqs->instance = instance; + tqs->http_status = http_status; + tqs->expected_amount_picked_up = expected_amount_picked_up; + tqs->expected_amount_authorized = expected_amount_authorized; + tqs->expected_amount_available = expected_amount_available; + + cmd.cls = tqs; + cmd.label = label; + cmd.run = &tip_query_run; + cmd.cleanup = &tip_query_cleanup; + + return cmd; +} + + /** * FIXME */ -- cgit v1.2.3