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