CYCAMORE
Loading...
Searching...
No Matches
build/cycamore/growth_region_tests.cc
Go to the documentation of this file.
1#include <sstream>
2
4#if CYCLUS_HAS_COIN
5
6namespace cycamore {
7
8// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
9void 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// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
19void GrowthRegionTests::TearDown() {
20 delete region;
21 delete ctx;
22}
23
24// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
25bool GrowthRegionTests::ManagesCommodity(cyclus::toolkit::Commodity& commodity) {
26 return region->sdmanager()->ManagesCommodity(commodity);
27}
28
29// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
30TEST_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// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
40cyclus::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
48#define CYCLUS_AGENT_TESTS_CONNECTED cyclus_agent_tests_connected
49#endif // CYCLUS_AGENT_TESTS_CONNECTED
50
51// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
52INSTANTIATE_TEST_SUITE_P(GrowthRegion, RegionTests,
53 Values(&GrowthRegionConstructor));
54INSTANTIATE_TEST_SUITE_P(GrowthRegion, AgentTests,
55 Values(&GrowthRegionConstructor));
56#endif // CYCLUS_HAS_COIN
static int cyclus_agent_tests_connected
INSTANTIATE_TEST_SUITE_P(DeployInst, InstitutionTests, Values(&DeployInstitutionConstructor))
int ConnectAgentTests()
This region determines if there is a need to meet a certain capacity (as defined via input) at each t...
TEST_F(EnrichmentTest, RequestQty)