Add county database interface and test

This commit is contained in:
Dan Paulat 2022-10-25 23:21:26 -05:00
parent 25f73ae105
commit 305e5c3698
6 changed files with 214 additions and 3 deletions

View file

@ -0,0 +1,38 @@
#include <scwx/qt/config/county_database.hpp>
#include <gtest/gtest.h>
namespace scwx
{
namespace qt
{
namespace config
{
class CountyDatabaseTest :
public testing::TestWithParam<std::pair<std::string, std::string>>
{
virtual void SetUp() { scwx::qt::config::CountyDatabase::Initialize(); }
};
TEST_P(CountyDatabaseTest, CountyName)
{
auto& [id, name] = GetParam();
std::string actualName = CountyDatabase::GetCountyName(id);
EXPECT_EQ(actualName, name);
}
INSTANTIATE_TEST_SUITE_P(
CountyDatabase,
CountyDatabaseTest,
testing::Values(std::make_pair("AZC013", "Maricopa"),
std::make_pair("MOC183", "St. Charles"),
std::make_pair("TXZ211", "Austin"),
std::make_pair("GMZ335", "Galveston Bay"),
std::make_pair("ANZ338", "New York Harbor")));
} // namespace config
} // namespace qt
} // namespace scwx

View file

@ -17,7 +17,8 @@ set(SRC_COMMON_TESTS source/scwx/common/color_table.test.cpp
source/scwx/common/products.test.cpp)
set(SRC_PROVIDER_TESTS source/scwx/provider/aws_level2_data_provider.test.cpp
source/scwx/provider/aws_level3_data_provider.test.cpp)
set(SRC_QT_CONFIG_TESTS source/scwx/qt/config/radar_site.test.cpp)
set(SRC_QT_CONFIG_TESTS source/scwx/qt/config/county_database.test.cpp
source/scwx/qt/config/radar_site.test.cpp)
set(SRC_QT_MANAGER_TESTS source/scwx/qt/manager/settings_manager.test.cpp)
set(SRC_UTIL_TESTS source/scwx/util/float.test.cpp
source/scwx/util/rangebuf.test.cpp