#pragma once #include "editor/editable_data_source.hpp" #include "editor/editor_tests_support/helpers.hpp" #include "generator/generator_tests_support/test_with_custom_mwms.hpp" #include "search/editor_delegate.hpp" #include "indexer/feature.hpp" #include "base/assert.hpp" #include "base/stl_add.hpp" #include namespace search { namespace tests_support { class TestWithCustomMwms : public generator::tests_support::TestWithCustomMwms { public: TestWithCustomMwms() { editor::tests_support::SetUpEditorForTesting(my::make_unique(m_dataSource)); } ~TestWithCustomMwms() override { editor::tests_support::TearDownEditorForTesting(); } template void EditFeature(FeatureID const & id, EditorFn && fn) { EditableDataSource::FeaturesLoaderGuard loader(m_dataSource, id.m_mwmId); FeatureType ft; CHECK(loader.GetFeatureByIndex(id.m_index, ft), ()); editor::tests_support::EditFeature(ft, std::forward(fn)); } }; } // namespace tests_support } // namespace search