[new downloader] Tests on Storage::GetUpdateInfo().

This commit is contained in:
Vladimir Byko-Ianko 2016-03-09 10:41:08 +03:00 committed by Sergey Yershov
parent 101559e7ab
commit 5dbf0c01f9

View file

@ -1296,6 +1296,29 @@ UNIT_TEST(StorageTest_GetNodeAttrsSingleMwm)
TEST(!nodeAttrs.m_present, ());
}
UNIT_TEST(StorageTest_GetUpdateInfoSingleMwm)
{
Storage storage(kSingleMwmCountriesTxt, make_unique<TestMapFilesDownloader>());
Storage::UpdateInfo updateInfo;
storage.GetUpdateInfo("Abkhazia", updateInfo);
TEST_EQUAL(updateInfo.m_numberOfMwmFilesToUpdate, 0, ());
TEST_EQUAL(updateInfo.m_totalUpdateSizeInBytes, 0, ());
storage.GetUpdateInfo("Country1", updateInfo);
TEST_EQUAL(updateInfo.m_numberOfMwmFilesToUpdate, 0, ());
TEST_EQUAL(updateInfo.m_totalUpdateSizeInBytes, 0, ());
storage.GetUpdateInfo("Disputable Territory", updateInfo);
TEST_EQUAL(updateInfo.m_numberOfMwmFilesToUpdate, 0, ());
TEST_EQUAL(updateInfo.m_totalUpdateSizeInBytes, 0, ());
storage.GetUpdateInfo(storage.GetRootId(), updateInfo);
TEST_EQUAL(updateInfo.m_numberOfMwmFilesToUpdate, 0, ());
TEST_EQUAL(updateInfo.m_totalUpdateSizeInBytes, 0, ());
}
UNIT_TEST(StorageTest_ParseStatus)
{
TEST_EQUAL(StatusAndError(NodeStatus::Undefined, NodeErrorCode::NoError),