Skip to content

Commit

Permalink
rename fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Dec 16, 2024
1 parent 81771fb commit 3e55a6e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/tests/src/solver/modelParser/testSystemConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ using namespace std::string_literals;
using namespace Antares::Solver;
using namespace Antares::Study;

struct Fixture
struct LibraryObjects
{
ModelParser::Model model1{.id = "node",
.description = "description",
Expand All @@ -47,17 +47,20 @@ struct Fixture

SystemParser::Parser parser;
ModelParser::Library library;
SystemModel::Library lib;
std::vector<SystemModel::Library> libraries;

Fixture()
LibraryObjects()
{
library.id = "std";
library.models = {model1};
libraries = {ModelConverter::convert(library)};
lib = ModelConverter::convert(library);
libraries = {lib};
}
~LibraryObjects() = default;
};

BOOST_FIXTURE_TEST_CASE(full_model_system, Fixture)
BOOST_FIXTURE_TEST_CASE(full_model_system, LibraryObjects)
{
const auto system = R"(
system:
Expand All @@ -84,7 +87,7 @@ BOOST_FIXTURE_TEST_CASE(full_model_system, Fixture)
BOOST_CHECK_EQUAL(systemModel.Components().at("N").getParameterValue("cost"), 30);
}

BOOST_FIXTURE_TEST_CASE(bad_param_name_in_component, Fixture)
BOOST_FIXTURE_TEST_CASE(bad_param_name_in_component, LibraryObjects)
{
const auto system = R"(
system:
Expand All @@ -106,7 +109,7 @@ BOOST_FIXTURE_TEST_CASE(bad_param_name_in_component, Fixture)
BOOST_CHECK_THROW(SystemConverter::convert(systemObj, libraries), std::invalid_argument);
}

BOOST_FIXTURE_TEST_CASE(library_not_existing, Fixture)
BOOST_FIXTURE_TEST_CASE(library_not_existing, LibraryObjects)
{
const auto system = R"(
system:
Expand All @@ -123,7 +126,7 @@ BOOST_FIXTURE_TEST_CASE(library_not_existing, Fixture)
BOOST_CHECK_THROW(SystemConverter::convert(systemObj, libraries), std::runtime_error);
}

BOOST_FIXTURE_TEST_CASE(model_not_existing, Fixture)
BOOST_FIXTURE_TEST_CASE(model_not_existing, LibraryObjects)
{
const auto system = R"(
system:
Expand All @@ -140,7 +143,7 @@ BOOST_FIXTURE_TEST_CASE(model_not_existing, Fixture)
BOOST_CHECK_THROW(SystemConverter::convert(systemObj, libraries), std::runtime_error);
}

BOOST_FIXTURE_TEST_CASE(bad_library_model_format, Fixture)
BOOST_FIXTURE_TEST_CASE(bad_library_model_format, LibraryObjects)
{
const auto system = R"(
system:
Expand Down

0 comments on commit 3e55a6e

Please sign in to comment.