/
githubmirror
/
omim
Обзор
Документация
Войти
/
githubmirror
/
omim
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
partners_api/partners_api_tests/yandex_tests.cpp
62 строки
2 KB
Maxim Pimenov
Got rid of the old style std/ includes for several files, mostly in map/ and platform/.
23 сен 2019, 13:25
23 сен 2019, 13:25
bfc0b02
Код
Авторство
О чём код?
#include "testing/testing.hpp" #include "partners_api/yandex_api.hpp" #include "geometry/latlon.hpp" #include "platform/platform.hpp" #include <string> namespace { using Runner = Platform::ThreadRunner; UNIT_TEST(Yandex_GetTaxiInfo) { ms::LatLon const from(55.796918, 37.537859); ms::LatLon const to(55.758213, 37.616093); std::string result; taxi::yandex::RawApi::GetTaxiInfo(from, to, result); TEST(!result.empty(), ()); } UNIT_CLASS_TEST(Runner, Yandex_GetAvailableProducts) { taxi::yandex::Api api("http://localhost:34568/partners"); ms::LatLon const from(55.796918, 37.537859); ms::LatLon const to(55.758213, 37.616093); std::vector<taxi::Product> resultProducts; api.GetAvailableProducts(from, to, [&resultProducts](std::vector<taxi::Product> const & products) { resultProducts = products; testing::Notify(); }, [](taxi::ErrorCode const code) { TEST(false, (code)); }); testing::Wait(); TEST(!resultProducts.empty(), ()); taxi::ErrorCode errorCode = taxi::ErrorCode::RemoteError; ms::LatLon const farPos(56.838197, 35.908507); api.GetAvailableProducts(from, farPos, [](std::vector<taxi::Product> const & products) { TEST(false, ()); }, [&errorCode](taxi::ErrorCode const code) { errorCode = code; testing::Notify(); }); testing::Wait(); TEST_EQUAL(errorCode, taxi::ErrorCode::NoProducts, ()); } } // namespace