Skip to content

Commit

Permalink
add checks
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Dec 17, 2024
1 parent 7058d96 commit 6c14f79
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/tests/src/solver/modelParser/testSystemConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,17 @@ BOOST_AUTO_TEST_CASE(Full_system_test)
libraries.push_back(ModelConverter::convert(parserModel.parse(libraryYaml2)));

SystemParser::System systemObj = parserSystem.parse(systemYaml);
/* BOOST_CHECK_NO_THROW(SystemConverter::convert(systemObj, libraries)); */
SystemConverter::convert(systemObj, libraries);
auto systemModel = SystemConverter::convert(systemObj, libraries);

BOOST_CHECK_EQUAL(systemModel.Components().size(), 3);
BOOST_CHECK_EQUAL(systemModel.Components().at("N").Id(), "N");
BOOST_CHECK_EQUAL(systemModel.Components().at("N").getModel()->Id(), "node");
BOOST_CHECK_EQUAL(systemModel.Components().at("N").getScenarioGroupId(), "group-234");

BOOST_CHECK_EQUAL(systemModel.Components().at("G").getModel()->Id(), "generator");
BOOST_CHECK_EQUAL(systemModel.Components().at("G").getParameterValue("cost"), 30);
BOOST_CHECK_EQUAL(systemModel.Components().at("G").getParameterValue("p_max"), 100);

BOOST_CHECK_EQUAL(systemModel.Components().at("D").getModel()->Id(), "demand");
BOOST_CHECK_EQUAL(systemModel.Components().at("D").getParameterValue("demand"), 100);
}

0 comments on commit 6c14f79

Please sign in to comment.