mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 23:10:05 +00:00
Level 3 category and product mappings
This commit is contained in:
parent
c9c77050ed
commit
822e523400
4 changed files with 213 additions and 6 deletions
56
test/source/scwx/common/products.test.cpp
Normal file
56
test/source/scwx/common/products.test.cpp
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
#include <scwx/common/products.hpp>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace common
|
||||
{
|
||||
|
||||
class GetLevel3ProductByAwipsIdTest :
|
||||
public testing::TestWithParam<std::pair<std::string, std::string>>
|
||||
{
|
||||
};
|
||||
|
||||
TEST(Products, GetLevel3AwipsIdsByProductTest)
|
||||
{
|
||||
const auto& awipsIds = GetLevel3AwipsIdsByProduct("SDR");
|
||||
|
||||
EXPECT_NE(std::find(awipsIds.cbegin(), awipsIds.cend(), "N0B"),
|
||||
awipsIds.cend());
|
||||
EXPECT_NE(std::find(awipsIds.cbegin(), awipsIds.cend(), "N1B"),
|
||||
awipsIds.cend());
|
||||
|
||||
EXPECT_EQ(std::find(awipsIds.cbegin(), awipsIds.cend(), "N0Q"),
|
||||
awipsIds.cend());
|
||||
}
|
||||
|
||||
TEST(Products, GetLevel3ProductsByCategoryTest)
|
||||
{
|
||||
const auto& products = GetLevel3ProductsByCategory(Level3ProductCategory::Reflectivity);
|
||||
|
||||
EXPECT_NE(std::find(products.cbegin(), products.cend(), "SDR"),
|
||||
products.cend());
|
||||
EXPECT_NE(std::find(products.cbegin(), products.cend(), "DR"),
|
||||
products.cend());
|
||||
|
||||
EXPECT_EQ(std::find(products.cbegin(), products.cend(), "DV"),
|
||||
products.cend());
|
||||
}
|
||||
|
||||
TEST_P(GetLevel3ProductByAwipsIdTest, AwipsIdTest)
|
||||
{
|
||||
auto& [awipsId, productName] = GetParam();
|
||||
|
||||
std::string product {GetLevel3ProductByAwipsId(awipsId)};
|
||||
EXPECT_EQ(product, productName);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(Products,
|
||||
GetLevel3ProductByAwipsIdTest,
|
||||
testing::Values(std::make_pair("N0Q", "DR"),
|
||||
std::make_pair("N0B", "SDR"),
|
||||
std::make_pair("XXX", "?")));
|
||||
|
||||
} // namespace common
|
||||
} // namespace scwx
|
||||
Loading…
Add table
Add a link
Reference in a new issue