Skip to content

Commit

Permalink
test components
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Dec 12, 2024
1 parent 1507574 commit 3289a8d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/tests/src/solver/modelParser/testSystemParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

0 comments on commit 3289a8d

Please sign in to comment.