[tests] get rid viator integration tests

This commit is contained in:
Arsentiy Milchakov 2018-05-17 16:58:43 +03:00 committed by Aleksandr Zatsepin
parent e877f75cac
commit 2b3f010ab7

View file

@ -15,84 +15,6 @@ using namespace partners_api;
namespace
{
UNIT_TEST(Viator_GetTopProducts)
{
string result;
viator::RawApi::GetTopProducts("684", "USD", 5, result);
TEST(!result.empty(), ());
my::Json root(result.c_str());
bool success;
FromJSONObjectOptionalField(root.get(), "success", success);
TEST(success, ());
}
UNIT_CLASS_TEST(AsyncGuiThread, Viator_GetTop5Products)
{
viator::Api api;
std::string const kSofia = "5630";
std::string resultId;
std::vector<viator::Product> resultProducts;
api.GetTop5Products(kSofia, "",
[&resultId, &resultProducts](std::string const & destId,
std::vector<viator::Product> const & products) {
resultId = destId;
resultProducts = products;
testing::Notify();
});
testing::Wait();
TEST_EQUAL(resultId, kSofia, ());
TEST(!resultProducts.empty(), ());
for (auto const & p : resultProducts)
TEST_EQUAL(p.m_currency, "USD", ());
resultId.clear();
resultProducts.clear();
api.GetTop5Products(kSofia, "RUB",
[&resultId, &resultProducts](std::string const & destId,
std::vector<viator::Product> const & products) {
resultId = destId;
resultProducts = products;
testing::Notify();
});
testing::Wait();
TEST_EQUAL(resultId, kSofia, ());
TEST(!resultProducts.empty(), ());
for (auto const & p : resultProducts)
TEST_EQUAL(p.m_currency, "USD", ());
resultId.clear();
resultProducts.clear();
api.GetTop5Products(kSofia, "GBP",
[&resultId, &resultProducts](std::string const & destId,
std::vector<viator::Product> const & products) {
resultId = destId;
resultProducts = products;
testing::Notify();
});
testing::Wait();
TEST_EQUAL(resultId, kSofia, ());
TEST(!resultProducts.empty(), ());
for (auto const & p : resultProducts)
TEST_EQUAL(p.m_currency, "GBP", ());
}
UNIT_TEST(Viator_SortProducts)
{
std::vector<viator::Product> products =