| 367 | } |
| 368 | |
| 369 | void EditorTest::GetFeatureStatusTest() |
| 370 | { |
| 371 | auto & editor = osm::Editor::Instance(); |
| 372 | |
| 373 | auto const mwmId = ConstructTestMwm([](TestMwmBuilder & builder) |
| 374 | { |
| 375 | TestCafe cafe(m2::PointD(1.0, 1.0), "London Cafe", "en"); |
| 376 | TestCafe unnamedCafe(m2::PointD(2.0, 2.0), "", "en"); |
| 377 | |
| 378 | builder.Add(cafe); |
| 379 | builder.Add(unnamedCafe); |
| 380 | }); |
| 381 | |
| 382 | ForEachCafeAtPoint(m_dataSource, m2::PointD(1.0, 1.0), [&editor](FeatureType & ft) |
| 383 | { |
| 384 | TEST_EQUAL(editor.GetFeatureStatus(ft.GetID()), FeatureStatus::Untouched, ()); |
| 385 | |
| 386 | osm::EditableMapObject emo; |
| 387 | FillEditableMapObject(editor, ft, emo); |
| 388 | SetBuildingLevels(emo, "1"); |
| 389 | TEST_EQUAL(editor.SaveEditedFeature(emo), osm::Editor::SaveResult::SavedSuccessfully, ()); |
| 390 | |
| 391 | TEST_EQUAL(editor.GetFeatureStatus(ft.GetID()), FeatureStatus::Modified, ()); |
| 392 | editor.MarkFeatureAsObsolete(emo.GetID()); |
| 393 | TEST_EQUAL(editor.GetFeatureStatus(emo.GetID()), FeatureStatus::Obsolete, ()); |
| 394 | }); |
| 395 | |
| 396 | ForEachCafeAtPoint(m_dataSource, m2::PointD(2.0, 2.0), [&editor](FeatureType & ft) |
| 397 | { |
| 398 | TEST_EQUAL(editor.GetFeatureStatus(ft.GetID()), FeatureStatus::Untouched, ()); |
| 399 | editor.DeleteFeature(ft.GetID()); |
| 400 | TEST_EQUAL(editor.GetFeatureStatus(ft.GetID()), FeatureStatus::Deleted, ()); |
| 401 | }); |
| 402 | |
| 403 | osm::EditableMapObject emo; |
| 404 | CreateCafeAtPoint({1.5, 1.5}, mwmId, emo); |
| 405 | |
| 406 | TEST_EQUAL(editor.GetFeatureStatus(emo.GetID()), FeatureStatus::Created, ()); |
| 407 | } |
| 408 | |
| 409 | void EditorTest::AreSomeFeatureChangesUploadedTest() |
| 410 | { |
nothing calls this directly
no test coverage detected