38 lines
1.5 KiB
C++
38 lines
1.5 KiB
C++
//
|
|
// Created by StanislausCichocki on 10.03.2025.
|
|
//
|
|
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
|
#include <spdlog/spdlog.h>
|
|
|
|
#include "../../src/services/Surplus.h"
|
|
#include "../../src/services/Cost/BillCharge.h"
|
|
#include "../../src/services/Cost/CalculateFinalSums.h"
|
|
#include "../../src/services/Cost/CostPipeline.h"
|
|
#include "../../src/services/Cost/NetworkProvider.h"
|
|
#include "../../src/services/Cost/ServiceCharge.h"
|
|
#include "../../src/services/Cost/GridCost/MeasurementServiceFee.h"
|
|
#include "../../src/services/Cost/GridCost/NetUsagePerformance.h"
|
|
#include "doctest/doctest.h"
|
|
#include "../model/Factory.h"
|
|
#include "../../src/Config.h"
|
|
|
|
TEST_CASE("Testing add function") {
|
|
std::vector<std::unique_ptr<Community> > communities;
|
|
for (int i = 0; i < 3; i++) {
|
|
communities.push_back(Factory::create_test_community());
|
|
}
|
|
Surplus surplus(communities);
|
|
surplus.CalculateSurplus();
|
|
CostPipeline costPipeline(communities);
|
|
costPipeline.addCostComponent(std::make_shared<NetworkProvider>());
|
|
costPipeline.addCostComponent(std::make_shared<BillCharge>());
|
|
costPipeline.addCostComponent(std::make_shared<MeasurementServiceFee>());
|
|
costPipeline.addCostComponent(std::make_shared<NetUsagePerformance>());
|
|
costPipeline.addCostComponent(std::make_shared<ServiceCharge>());
|
|
costPipeline.addCostComponent(std::make_shared<CalculateFinalSums>());
|
|
costPipeline.calculateFinalCost();
|
|
|
|
LOG_DEBUG_INFO("{}",communities[0]->total);
|
|
CHECK(true);
|
|
}
|