[partners_api] tests fix

This commit is contained in:
Arsentiy Milchakov 2018-08-01 14:17:51 +03:00 committed by Slava
parent ebe4e348a5
commit c0e546812e
2 changed files with 5 additions and 3 deletions

View file

@ -129,7 +129,7 @@ void MakeFromJson(std::string const & src, std::vector<taxi::Product> & products
return;
auto const price = json_object_get(root.get(), "Price");
if (price == nullptr)
if (price == nullptr || json_is_null(price))
return;
double p = 0.0;

View file

@ -65,7 +65,8 @@ UNIT_CLASS_TEST(AsyncGuiThreadBooking, Booking_GetBlockAvailability)
auto price = BlockInfo::kIncorrectPrice;
string currency;
string hotelId;
api.GetBlockAvailability(std::move(params), [&hotelId, &price, &currency](std::string const & id,
auto copy = params;
api.GetBlockAvailability(std::move(copy), [&hotelId, &price, &currency](std::string const & id,
Blocks const & blocks)
{
hotelId = id;
@ -88,7 +89,8 @@ UNIT_CLASS_TEST(AsyncGuiThreadBooking, Booking_GetBlockAvailability)
double price = std::numeric_limits<double>::max();
string currency;
string hotelId;
api.GetBlockAvailability(std::move(params), [&hotelId, &price, &currency](std::string const & id,
auto copy = params;
api.GetBlockAvailability(std::move(copy), [&hotelId, &price, &currency](std::string const & id,
Blocks const & blocks)
{
hotelId = id;