diff options
author | Arsentiy Milchakov <milcars@mapswithme.com> | 2017-10-12 13:18:24 +0300 |
---|---|---|
committer | Yuri Gorshenin <mipt.vi002@gmail.com> | 2017-10-12 15:40:58 +0300 |
commit | 1edf04cfdeede071e6fd543d036f028e5c41ad46 (patch) | |
tree | 79555dedcabd52b8841a7f6176aa09ab591b3828 /indexer/indexer_tests | |
parent | 9f4a64c7fdffb58d3b421e4c6e2877c87a66f1ff (diff) |
[ugc] categories for place page + csv_reader fixes
Diffstat (limited to 'indexer/indexer_tests')
-rw-r--r-- | indexer/indexer_tests/CMakeLists.txt | 1 | ||||
-rw-r--r-- | indexer/indexer_tests/indexer_tests.pro | 1 | ||||
-rw-r--r-- | indexer/indexer_tests/ugc_types_test.cpp | 46 |
3 files changed, 48 insertions, 0 deletions
diff --git a/indexer/indexer_tests/CMakeLists.txt b/indexer/indexer_tests/CMakeLists.txt index 101b72eab3..cfd645fb81 100644 --- a/indexer/indexer_tests/CMakeLists.txt +++ b/indexer/indexer_tests/CMakeLists.txt @@ -36,6 +36,7 @@ set( test_polylines.hpp test_type.cpp trie_test.cpp + ugc_types_test.cpp visibility_test.cpp wheelchair_tests.cpp ) diff --git a/indexer/indexer_tests/indexer_tests.pro b/indexer/indexer_tests/indexer_tests.pro index 9485d04fac..7a51e94723 100644 --- a/indexer/indexer_tests/indexer_tests.pro +++ b/indexer/indexer_tests/indexer_tests.pro @@ -59,5 +59,6 @@ SOURCES += \ test_polylines.cpp \ test_type.cpp \ trie_test.cpp \ + ugc_types_test.cpp \ visibility_test.cpp \ wheelchair_tests.cpp \ diff --git a/indexer/indexer_tests/ugc_types_test.cpp b/indexer/indexer_tests/ugc_types_test.cpp new file mode 100644 index 0000000000..a1dfb13290 --- /dev/null +++ b/indexer/indexer_tests/ugc_types_test.cpp @@ -0,0 +1,46 @@ +#include "testing/testing.hpp" + +#include "indexer/classificator.hpp" +#include "indexer/classificator_loader.hpp" +#include "indexer/ftraits.hpp" + +UNIT_TEST(UgcTypes_Full) +{ + classificator::Load(); + Classificator const & c = classif(); + + using ftraits::UGC; + + feature::TypesHolder holder; + { + holder.Assign(c.GetTypeByPath({"amenity", "bank"})); + TEST(UGC::IsUGCAvailable(holder), ()); + TEST(UGC::IsRatingAvailable(holder), ()); + TEST(UGC::IsReviewsAvailable(holder), ()); + TEST(!UGC::IsDetailsAvailable(holder), ()); + ftraits::UGCRatingCategories expected = {"quality", "service", "value_for_money"}; + TEST_EQUAL(UGC::GetCategories(holder), expected, ()); + } + { + holder.Assign(c.GetTypeByPath({"tourism", "information", "office"})); + TEST(UGC::IsUGCAvailable(holder), ()); + TEST(UGC::IsRatingAvailable(holder), ()); + TEST(UGC::IsReviewsAvailable(holder), ()); + TEST(!UGC::IsDetailsAvailable(holder), ()); + ftraits::UGCRatingCategories expected = {"quality", "service", "value_for_money"}; + TEST_EQUAL(UGC::GetCategories(holder), expected, ()); + } + { + holder.Assign(c.GetTypeByPath({"amenity", "hospital"})); + TEST(UGC::IsUGCAvailable(holder), ()); + TEST(UGC::IsRatingAvailable(holder), ()); + TEST(UGC::IsReviewsAvailable(holder), ()); + TEST(!UGC::IsDetailsAvailable(holder), ()); + ftraits::UGCRatingCategories expected = {"expertise", "equipment", "value_for_money"}; + TEST_EQUAL(UGC::GetCategories(holder), expected, ()); + } + { + holder.Assign(c.GetTypeByPath({"traffic_calming", "bump"})); + TEST(!UGC::IsUGCAvailable(holder), ()); + } +} |