50 "<prototypes> <val>foobar</val> <val>foobar</val> </prototypes>"
51 "<build_times> <val>1</val> <val>3</val> </build_times>"
52 "<n_build> <val>1</val> <val>7</val> </n_build>"
56 cyclus::MockSim sim(cyclus::AgentSpec(
":cycamore:DeployInst"), config, simdur);
57 sim.DummyProto(
"foobar");
60 cyclus::SqlStatement::Ptr stmt = sim.db().db().Prepare(
61 "SELECT COUNT(*) FROM AgentEntry WHERE Prototype = 'foobar' AND EnterTime = 1;"
64 EXPECT_EQ(1, stmt->GetInt(0));
66 stmt = sim.db().db().Prepare(
67 "SELECT COUNT(*) FROM AgentEntry WHERE Prototype = 'foobar' AND EnterTime = 3;"
70 EXPECT_EQ(7, stmt->GetInt(0));
77 "<prototypes> <val>foobar</val> <val>foobar</val> <val>foobar</val> </prototypes>"
78 "<build_times> <val>1</val> <val>1</val> <val>2</val> </build_times>"
79 "<n_build> <val>1</val> <val>7</val> <val>3</val> </n_build>"
80 "<lifetimes> <val>1</val> <val>2</val> <val>-1</val> </lifetimes>"
84 cyclus::MockSim sim(cyclus::AgentSpec(
":cycamore:DeployInst"), config, simdur);
85 sim.DummyProto(
"foobar");
89 cyclus::SqlStatement::Ptr stmt = sim.db().db().Prepare(
90 "SELECT COUNT(*) FROM AgentEntry WHERE Prototype = 'foobar' AND EnterTime = 1 AND Lifetime = 1;"
93 EXPECT_EQ(1, stmt->GetInt(0));
95 stmt = sim.db().db().Prepare(
96 "SELECT COUNT(*) FROM AgentEntry WHERE Prototype = 'foobar' AND EnterTime = 1 AND Lifetime = 2;"
99 EXPECT_EQ(7, stmt->GetInt(0));
101 stmt = sim.db().db().Prepare(
102 "SELECT COUNT(*) FROM AgentEntry WHERE Prototype = 'foobar' AND EnterTime = 2 AND Lifetime = -1;"
105 EXPECT_EQ(3, stmt->GetInt(0));
108 stmt = sim.db().db().Prepare(
109 "SELECT COUNT(*) FROM AgentEntry As e JOIN AgentExit AS x ON x.AgentId = e.AgentId WHERE e.Prototype = 'foobar' AND x.ExitTime = 1;"
112 EXPECT_EQ(1, stmt->GetInt(0));
114 stmt = sim.db().db().Prepare(
115 "SELECT COUNT(*) FROM AgentEntry As e JOIN AgentExit AS x ON x.AgentId = e.AgentId WHERE e.Prototype = 'foobar' AND x.ExitTime = 2;"
118 EXPECT_EQ(7, stmt->GetInt(0));
121 stmt = sim.db().db().Prepare(
122 "SELECT COUNT(*) FROM AgentExit;"
125 EXPECT_EQ(8, stmt->GetInt(0));
130 "<prototypes> <val>foobar</val> <val>foobar</val> <val>foobar</val> </prototypes>"
131 "<build_times> <val>1</val> <val>1</val> <val>2</val> </build_times>"
132 "<n_build> <val>1</val> <val>7</val> <val>3</val> </n_build>"
133 "<lifetimes> <val>1</val> <val>1</val> <val>-1</val> </lifetimes>"
137 cyclus::MockSim sim(cyclus::AgentSpec(
":cycamore:DeployInst"), config, simdur);
138 sim.DummyProto(
"foobar");
142 cyclus::SqlStatement::Ptr stmt = sim.db().db().Prepare(
143 "SELECT COUNT(*) FROM Prototypes WHERE Prototype = 'foobar_life_1';"
146 EXPECT_EQ(1, stmt->GetInt(0));
150 stmt = sim.db().db().Prepare(
151 "SELECT COUNT(*) FROM Prototypes WHERE Prototype = 'foobar';"
154 EXPECT_EQ(1, stmt->GetInt(0));
208 EXPECT_EQ(src_inst->TotalCapacity(commodity), 0);
209 src_inst->BuildNotify(producer);
210 EXPECT_EQ(src_inst->TotalCapacity(commodity), capacity);
211 src_inst->DecomNotify(producer);
212 EXPECT_EQ(src_inst->TotalCapacity(commodity), 0);