CYCAMORE
src/growth_region_tests.cc
Go to the documentation of this file.
1 #include <sstream>
2 
3 #include "growth_region_tests.h"
4 
5 namespace cycamore {
6 
7 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
9  ctx = new cyclus::Context(&ti, &rec);
11  commodity_name = "commod";
12  demand_type = "linear";
13  demand_params = "5 5";
14  demand_start = "0";
15 }
16 
17 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
19  delete region;
20  delete ctx;
21 }
22 
23 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
24 bool GrowthRegionTests::ManagesCommodity(cyclus::toolkit::Commodity& commodity) {
25  return region->sdmanager()->ManagesCommodity(commodity);
26 }
27 
28 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
29 TEST_F(GrowthRegionTests, init) {
30  cyclus::toolkit::Commodity commodity(commodity_name);
31  cyclus::toolkit::ExpFunctionFactory eff;
32  region->sdmanager()->RegisterCommodity(commodity, eff.GetFunctionPtr("2.0 4.0"));
33  EXPECT_TRUE(ManagesCommodity(commodity));
34 }
35 
36 } // namespace cycamore
37 
38 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
39 cyclus::Agent* GrowthRegionConstructor(cyclus::Context* ctx) {
40  return new cycamore::GrowthRegion(ctx);
41 }
42 
43 // required to get functionality in cyclus agent unit tests library
44 #ifndef CYCLUS_AGENT_TESTS_CONNECTED
45 int ConnectAgentTests();
47 #define CYCLUS_AGENT_TESTS_CONNECTED cyclus_agent_tests_connected
48 #endif // CYCLUS_AGENT_TESTS_CONNECTED
49 
50 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
51 INSTANTIATE_TEST_CASE_P(GrowthRegion, RegionTests,
52  Values(&GrowthRegionConstructor));
53 INSTANTIATE_TEST_CASE_P(GrowthRegion, AgentTests,
54  Values(&GrowthRegionConstructor));
cyclus::Agent * GrowthRegionConstructor(cyclus::Context *ctx)
This region determines if there is a need to meet a certain capacity (as defined via input) at each t...
cyclus::toolkit::SupplyDemandManager * sdmanager()
INSTANTIATE_TEST_CASE_P(GrowthRegion, RegionTests, Values(&GrowthRegionConstructor))
int ConnectAgentTests()
TEST_F(EnrichmentTest, RequestQty)
bool ManagesCommodity(cyclus::toolkit::Commodity &commodity)
static int cyclus_agent_tests_connected