From 6c14f7977dc7f99ea9539e435bd5f2e25d897ff8 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Tue, 17 Dec 2024 10:06:25 +0100 Subject: [PATCH] add checks --- .../solver/modelParser/testSystemConverter.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/tests/src/solver/modelParser/testSystemConverter.cpp b/src/tests/src/solver/modelParser/testSystemConverter.cpp index bb7c9b022c..1ba1bbb1fd 100644 --- a/src/tests/src/solver/modelParser/testSystemConverter.cpp +++ b/src/tests/src/solver/modelParser/testSystemConverter.cpp @@ -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); }