From f7ac8fe6e47b2374e7631e934e9aae3f60f05ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Jensen?= Date: Fri, 25 May 2018 15:35:06 +0200 Subject: [PATCH] Observed data parsing. Add address creation unit test --- .../FileInterface/RifEclipseSummaryAddress.cpp | 2 +- .../UnitTests/ObservedDataParser-Test.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ApplicationCode/FileInterface/RifEclipseSummaryAddress.cpp b/ApplicationCode/FileInterface/RifEclipseSummaryAddress.cpp index a22f7eb6ad..66c0c74b60 100644 --- a/ApplicationCode/FileInterface/RifEclipseSummaryAddress.cpp +++ b/ApplicationCode/FileInterface/RifEclipseSummaryAddress.cpp @@ -338,7 +338,7 @@ std::tuple RifEclipseSummaryAddress::ijkTupleFromUiText(const std //-------------------------------------------------------------------------------------------------- std::string RifEclipseSummaryAddress::formatUiTextRegionToRegion() const { - return std::to_string(this->regionNumber()) + " -> " + return std::to_string(this->regionNumber()) + " - " + std::to_string(this->regionNumber2()); } diff --git a/ApplicationCode/UnitTests/ObservedDataParser-Test.cpp b/ApplicationCode/UnitTests/ObservedDataParser-Test.cpp index 275e3b8a28..348ccd8027 100644 --- a/ApplicationCode/UnitTests/ObservedDataParser-Test.cpp +++ b/ApplicationCode/UnitTests/ObservedDataParser-Test.cpp @@ -784,6 +784,24 @@ TEST(RifKeywordBasedRsmspecParserTest, TestTimeSteps) EXPECT_TRUE(firstDate == QDateTime::fromTime_t(timeSteps[0])); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +TEST(RifKeywordBasedRsmspecParserTest, TestAddressCreation) +{ + std::string quantityName = "LCABC"; + std::vector< std::string > headerColumn; + headerColumn.push_back("wellName"); + headerColumn.push_back("lgrName"); + headerColumn.push_back("12 14 16"); + + RifEclipseSummaryAddress address = RifEclipseUserDataKeywordTools::makeAndFillAddress(quantityName, headerColumn); + + EXPECT_TRUE(address.isValid()); + EXPECT_EQ(address.category(), RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION_LGR); + EXPECT_EQ(address.uiText(), "LCABC:lgrName:wellName:12, 14, 16"); +} + //-------------------------------------------------------------------------------------------------- /// //--------------------------------------------------------------------------------------------------