From 3289a8deb08c5d34666e73f677d58bc71b9e0aec Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Thu, 12 Dec 2024 11:16:02 +0100 Subject: [PATCH] test components --- .../solver/modelParser/testSystemParser.cpp | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/tests/src/solver/modelParser/testSystemParser.cpp b/src/tests/src/solver/modelParser/testSystemParser.cpp index 68bfde53da..0b68f767e9 100644 --- a/src/tests/src/solver/modelParser/testSystemParser.cpp +++ b/src/tests/src/solver/modelParser/testSystemParser.cpp @@ -103,3 +103,27 @@ BOOST_AUTO_TEST_CASE(one_component) BOOST_CHECK_EQUAL(systemObj.components[0].model, "abcde"); BOOST_CHECK_EQUAL(systemObj.components[0].scenarioGroup, "group-234"); } + +BOOST_AUTO_TEST_CASE(two_components) +{ + SystemParser::Parser parser; + const auto system = R"( + system: + id: base_system + description: one simple component + components: + - id: N + model: std.node + scenario-group: group-234 + - id: G + model: std.generator + scenario-group: group-thermal + )"s; + SystemParser::System systemObj = parser.parse(system); + BOOST_CHECK_EQUAL(systemObj.components[0].id, "N"); + BOOST_CHECK_EQUAL(systemObj.components[0].model, "std.node"); + BOOST_CHECK_EQUAL(systemObj.components[0].scenarioGroup, "group-234"); + BOOST_CHECK_EQUAL(systemObj.components[1].id, "G"); + BOOST_CHECK_EQUAL(systemObj.components[1].model, "std.generator"); + BOOST_CHECK_EQUAL(systemObj.components[1].scenarioGroup, "group-thermal"); +}