11#include < gmock/gmock.h>
2- #include < rest/controller/PricePlanComparatorController.h>
32#include < rest/configuration.h>
3+ #include < rest/controller/PricePlanComparatorController.h>
4+
45#include < string>
56
67#include < boost/beast/http.hpp>
@@ -20,10 +21,8 @@ class PricePlanComparatorControllerTest : public ::testing::Test {
2021
2122TEST_F (PricePlanComparatorControllerTest, CompareShouldCalculateCostForMeterReadingsForEveryPricePlan) {
2223 const std::string smart_meter_id = " smart-meter-0" ;
23- std::vector<ElectricityReading> readings = {
24- {std::chrono::system_clock::now () - std::chrono::seconds (3600 ), 15 * 10000 },
25- {std::chrono::system_clock::now (), 5 * 10000 }
26- };
24+ std::vector<ElectricityReading> readings = {{std::chrono::system_clock::now () - std::chrono::hours{1 }, 15 * 10000 },
25+ {std::chrono::system_clock::now (), 5 * 10000 }};
2726 meterReadingService.storeReadings (smart_meter_id, readings);
2827 http::request<http::string_body> req;
2928 std::vector<std::string> queries = {smart_meter_id};
@@ -78,10 +77,8 @@ TEST_F(PricePlanComparatorControllerTest, RecommandShouldRecommendLimitedCheapes
7877
7978TEST_F (PricePlanComparatorControllerTest, RecommandShouldRecommendCheapestPricePlansMoreThanLimitAvailableForMeterUsage) {
8079 const std::string smart_meter_id = " smart-meter-0" ;
81- std::vector<ElectricityReading> readings = {
82- {std::chrono::system_clock::now () - std::chrono::seconds (3600 ), 25 * 10000 },
83- {std::chrono::system_clock::now (), 3 * 10000 }
84- };
80+ std::vector<ElectricityReading> readings = {{std::chrono::system_clock::now () - std::chrono::hours (1 ), 25 * 10000 },
81+ {std::chrono::system_clock::now (), 3 * 10000 }};
8582 meterReadingService.storeReadings (smart_meter_id, readings);
8683 http::request<http::string_body> req;
8784 std::vector<std::string> queries = {smart_meter_id, " limit" , " 5" };
0 commit comments