2017-10-24 07:19:36 -05:00
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
2019-10-18 07:28:02 -05:00
|
|
|
#include "RiuSummaryQuantityNameInfoProvider.h"
|
2017-10-24 07:19:36 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-24 07:19:36 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-10-18 07:28:02 -05:00
|
|
|
TEST( RiuSummaryQuantityNameInfoProvider, TestInit )
|
2017-10-24 07:19:36 -05:00
|
|
|
{
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
std::string s( "SRSFC" );
|
2019-10-18 07:28:02 -05:00
|
|
|
auto cat = RiuSummaryQuantityNameInfoProvider::instance()->categoryFromQuantityName( s );
|
|
|
|
EXPECT_TRUE( cat == RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT );
|
2018-08-30 04:17:37 -05:00
|
|
|
|
2019-10-18 07:28:02 -05:00
|
|
|
auto longName = RiuSummaryQuantityNameInfoProvider::instance()->longNameFromQuantityName( s );
|
|
|
|
EXPECT_TRUE( longName == "Reach brine concentration" );
|
2018-08-30 04:17:37 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
std::string s( "SRSFC" );
|
2019-10-18 07:28:02 -05:00
|
|
|
auto test = RiuSummaryQuantityNameInfoProvider::instance()->longNameFromQuantityName( s );
|
2017-10-24 07:19:36 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
EXPECT_TRUE( test == "Reach brine concentration" );
|
2017-10-24 07:19:36 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
std::string s( "does not exist" );
|
2019-10-18 07:28:02 -05:00
|
|
|
auto cat = RiuSummaryQuantityNameInfoProvider::instance()->categoryFromQuantityName( s );
|
|
|
|
EXPECT_TRUE( cat == RifEclipseSummaryAddress::SUMMARY_INVALID );
|
2018-08-30 04:17:37 -05:00
|
|
|
|
2019-10-18 07:28:02 -05:00
|
|
|
auto longName = RiuSummaryQuantityNameInfoProvider::instance()->longNameFromQuantityName( s );
|
|
|
|
|
|
|
|
EXPECT_TRUE( longName == "" );
|
2018-08-30 04:17:37 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
std::string s( "does not exist" );
|
2019-10-18 07:28:02 -05:00
|
|
|
auto test = RiuSummaryQuantityNameInfoProvider::instance()->longNameFromQuantityName( s );
|
2018-08-30 04:17:37 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
EXPECT_TRUE( test == "" );
|
2018-08-30 04:17:37 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
std::string s( "does not exist" );
|
2019-10-18 07:28:02 -05:00
|
|
|
auto test = RiuSummaryQuantityNameInfoProvider::instance()->longNameFromQuantityName( s, true );
|
2017-10-24 07:19:36 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
EXPECT_TRUE( test == s );
|
2017-10-24 07:19:36 -05:00
|
|
|
}
|
|
|
|
}
|
2018-08-30 06:30:54 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-08-30 06:30:54 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-10-18 07:28:02 -05:00
|
|
|
TEST( RiuSummaryQuantityNameInfoProvider, TestCustomNaming )
|
2018-08-30 06:30:54 -05:00
|
|
|
{
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
std::string s( "SRSFCABC" );
|
2019-10-18 07:28:02 -05:00
|
|
|
auto cat = RiuSummaryQuantityNameInfoProvider::instance()->categoryFromQuantityName( s );
|
|
|
|
EXPECT_TRUE( cat == RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT );
|
2018-08-30 06:30:54 -05:00
|
|
|
|
2019-10-18 07:28:02 -05:00
|
|
|
auto longName = RiuSummaryQuantityNameInfoProvider::instance()->longNameFromQuantityName( s );
|
|
|
|
EXPECT_TRUE( longName == "Reach brine concentration" );
|
2018-08-30 06:30:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
std::string s( "BHD__ABC" );
|
2019-10-18 07:28:02 -05:00
|
|
|
auto test = RiuSummaryQuantityNameInfoProvider::instance()->longNameFromQuantityName( s );
|
2018-08-30 06:30:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
EXPECT_TRUE( test == "Hydraulic head" );
|
2018-08-30 06:30:54 -05:00
|
|
|
}
|
|
|
|
}
|
2020-10-02 11:25:53 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
TEST( RiuSummaryQuantityNameInfoProvider, Test6x )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::string s( "GLIT" );
|
|
|
|
auto cat = RiuSummaryQuantityNameInfoProvider::instance()->categoryFromQuantityName( s );
|
|
|
|
EXPECT_TRUE( cat == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP );
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2020-10-30 01:45:56 -05:00
|
|
|
std::string s( "WSBVPROP" );
|
2020-10-02 11:25:53 -05:00
|
|
|
auto cat = RiuSummaryQuantityNameInfoProvider::instance()->categoryFromQuantityName( s );
|
2020-10-30 01:45:56 -05:00
|
|
|
EXPECT_TRUE( cat == RifEclipseSummaryAddress::SUMMARY_WELL );
|
2020-10-02 11:25:53 -05:00
|
|
|
}
|
|
|
|
}
|