[halloween] banner ids + tests

This commit is contained in:
Arsentiy Milchakov 2017-10-13 14:34:34 +03:00 committed by Roman Kuznetsov
parent c4cb29dcc4
commit 9220b3e2f3
3 changed files with 22 additions and 0 deletions

View file

@ -6,10 +6,12 @@ namespace
auto const kTourismPlacementId = "29c1bc85b46442b5a370552916aa6822";
auto const kNavigationPlacementId = "00af522ea7f94b77b6c671c7e1b13c3f";
auto const kNonTourismPlacementId = "67ebcbd0af8345f18cccfb230ca08a17";
auto const kHalloweenPlacementId = "e0c1d4d9c88c4670b9541116bcb75c5f";
#else
auto const kTourismPlacementId = "d298f205fb8a47aaafb514d2b5b8cf55";
auto const kNavigationPlacementId = "fbd54c31a20347a6b5d6654510c542a4";
auto const kNonTourismPlacementId = "94b8d70370a643929aa4c8c764d25e5b";
auto const kHalloweenPlacementId = "2bab47102d38485996788ab9b602ce2c";
#endif
} // namespace
@ -69,6 +71,8 @@ Mopub::Mopub()
{"amenity", "atm"},
{"amenity", "bureau_de_change"}},
kNonTourismPlacementId);
AppendEntry({{"sponsored", "halloween"}}, kHalloweenPlacementId);
}
std::string Mopub::GetBannerIdForOtherTypes() const

View file

@ -144,5 +144,21 @@ UNIT_TEST(AdsEngine_Smoke)
TEST_EQUAL(result[0].m_type, ads::Banner::Type::Google, ());
TEST_EQUAL(result[0].m_bannerId, google.GetSearchBannerId(), ());
}
{
feature::TypesHolder holder;
holder.Assign(c.GetTypeByPath({"sponsored", "halloween"}));
TEST(engine.HasBanner(holder, {"Russian Federation"}, "ru"), ());
auto result = engine.GetBanners(holder, {"Russian Federation"}, "ru");
TEST(!result.empty(), ());
CheckIds(result, {"2bab47102d38485996788ab9b602ce2c"});
}
{
feature::TypesHolder holder;
holder.Assign(c.GetTypeByPath({"sponsored", "halloween"}));
TEST(engine.HasBanner(holder, {"United States"}, "en"), ());
auto result = engine.GetBanners(holder, {"United States"}, "en");
TEST(!result.empty(), ());
CheckIds(result, {"2bab47102d38485996788ab9b602ce2c"});
}
}
}

View file

@ -104,6 +104,8 @@ Rb::Rb()
AppendEntry({{"building"}}, kBuildingPlacementId);
AppendExcludedTypes({{"sponsored", "halloween"}});
AppendSupportedCountries(kSupportedCountries);
AppendSupportedUserLanguages(kSupportedLanguages);
}