Skip to content

Commit

Permalink
Clean thermal lists : removing use of mapping in a unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
guilpier-code committed Dec 22, 2023
1 parent ee1e5f5 commit 7c7b6ea
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ BOOST_AUTO_TEST_SUITE(s)
BOOST_FIXTURE_TEST_CASE(ThermalClusterList_loadFromFolder_basic, FixtureFull)
{
clusterList.loadFromFolder(*study, folder, area);
auto cluster = clusterList.mapping["some cluster"];
auto cluster = clusterList.find("some cluster");

BOOST_CHECK(cluster->startupCost == 70000.0);
BOOST_CHECK(cluster->costgeneration == useCostTimeseries);
Expand All @@ -161,7 +161,7 @@ BOOST_FIXTURE_TEST_CASE(ThermalClusterList_loadFromFolder_basic, FixtureFull)
BOOST_FIXTURE_TEST_CASE(checkCo2_checkCO2CostColumnNumber_OK, FixtureFull)
{
area->thermal.list.loadFromFolder(*study, folder, area);
auto cluster = area->thermal.list.mapping["some cluster"];
auto cluster = area->thermal.list.find("some cluster");

cluster->series.timeSeries.reset(3, 8760);

Expand All @@ -176,7 +176,7 @@ BOOST_FIXTURE_TEST_CASE(checkCo2_checkCO2CostColumnNumber_OK, FixtureFull)
BOOST_FIXTURE_TEST_CASE(checkCo2_checkCO2CostColumnNumber_KO, FixtureFull)
{
area->thermal.list.loadFromFolder(*study, folder, area);
auto cluster = area->thermal.list.mapping["some cluster"];
auto cluster = area->thermal.list.find("some cluster");

cluster->series.timeSeries.reset(3, 8760);

Expand All @@ -192,7 +192,7 @@ BOOST_FIXTURE_TEST_CASE(checkCo2_checkCO2CostColumnNumber_KO, FixtureFull)
BOOST_FIXTURE_TEST_CASE(checkFuelAndCo2_checkColumnNumber_OK, FixtureFull)
{
area->thermal.list.loadFromFolder(*study, folder, area);
auto cluster = area->thermal.list.mapping["some cluster"];
auto cluster = area->thermal.list.find("some cluster");

cluster->series.timeSeries.reset(3, 8760);

Expand All @@ -208,7 +208,7 @@ BOOST_FIXTURE_TEST_CASE(checkFuelAndCo2_checkColumnNumber_OK, FixtureFull)
BOOST_FIXTURE_TEST_CASE(ThermalCluster_costGenManualCalculationOfMarketBidAndMarginalCostPerHour, FixtureFull)
{
clusterList.loadFromFolder(*study, folder, area);
auto cluster = clusterList.mapping["some cluster"];
auto cluster = clusterList.find("some cluster");

cluster->costgeneration = Data::setManually;
cluster->ComputeCostTimeSeries();
Expand All @@ -223,11 +223,11 @@ BOOST_FIXTURE_TEST_CASE(ThermalCluster_costGenTimeSeriesCalculationOfMarketBidAn
TimeSeriesFile co2("CO2Cost.txt", 8760);

clusterList.loadFromFolder(*study, folder, area);
auto cluster = clusterList.mapping["some cluster"];
auto cluster = clusterList.find("some cluster");

cluster->modulation.reset(1, 8760);
cluster->ecoInput.loadFromFolder(*study, folder);
fillThermalEconomicTimeSeries(cluster.get());
fillThermalEconomicTimeSeries(cluster);

cluster->ComputeCostTimeSeries();

Expand All @@ -238,7 +238,7 @@ BOOST_FIXTURE_TEST_CASE(ThermalCluster_costGenTimeSeriesCalculationOfMarketBidAn
BOOST_FIXTURE_TEST_CASE(computeMarketBidCost, FixtureFull)
{
clusterList.loadFromFolder(*study, folder, area);
auto cluster = clusterList.mapping["some cluster"];
auto cluster = clusterList.find("some cluster");

BOOST_CHECK_CLOSE(cluster->computeMarketBidCost(1, 2, 1), 24.12, 0.001);
}
Expand Down

0 comments on commit 7c7b6ea

Please sign in to comment.