| 1260 | } |
| 1261 | |
| 1262 | void EditorTest::LoadExistingEditsXml() |
| 1263 | { |
| 1264 | char const * data = R"( |
| 1265 | <?xml version="1.0"?> |
| 1266 | <mapsme format_version="1"> |
| 1267 | <mwm name="TestCountry" version="221119"> |
| 1268 | <delete /> |
| 1269 | <modify /> |
| 1270 | <create> |
| 1271 | <node lat="54.0446163" lon="27.6597626" mwm_file_index="4293918720" timestamp="2022-12-09T18:58:28Z"> |
| 1272 | <tag k="name:ru" v="xxx" /> |
| 1273 | <tag k="amenity" v="bar" /> |
| 1274 | </node> |
| 1275 | </create> |
| 1276 | <obsolete /> |
| 1277 | </mwm> |
| 1278 | </mapsme> |
| 1279 | )"; |
| 1280 | |
| 1281 | ConstructTestMwm([](editor::testing::TestMwmBuilder &) {}); |
| 1282 | |
| 1283 | pugi::xml_document doc; |
| 1284 | TEST(doc.load_string(data), ()); |
| 1285 | |
| 1286 | auto memStorage = std::make_unique<editor::InMemoryStorage>(); |
| 1287 | memStorage->Save(doc); |
| 1288 | |
| 1289 | auto & editor = osm::Editor::Instance(); |
| 1290 | editor.SetStorageForTesting(std::move(memStorage)); |
| 1291 | |
| 1292 | editor.LoadEdits(); |
| 1293 | TEST_EQUAL(editor.m_features.Get()->size(), 1, ()); |
| 1294 | } |
| 1295 | |
| 1296 | } // namespace testing |
| 1297 | } // namespace editor |