3 #include <StjTowerEnergyListVariation.h>
4 #include <StjTowerEnergyList.h>
5 #include "StjTowerEnergyVariation.h"
6 #include "StjTowerEnergyVariationEnergy.h"
12 #include "StjTowerEnergyListVariationTest.hh"
19 void StjTowerEnergyListVariationTest::setUp()
24 void StjTowerEnergyListVariationTest::tearDown()
30 void StjTowerEnergyListVariationTest::testEnergyPlus5()
36 StjTowerEnergyList listIn;
40 listIn.push_back(energy1);
44 listIn.push_back(energy2);
46 StjTowerEnergyList listExpected;
47 energy1.energy *= (1.0 + 0.05);
48 energy2.energy *= (1.0 + 0.05);
49 listExpected.push_back(energy1);
50 listExpected.push_back(energy2);
53 StjTowerEnergyList listActual = (*variation)(listIn);
76 CPPUNIT_ASSERT_EQUAL( listExpected, listActual );
81 void StjTowerEnergyListVariationTest::testEnergyMinus5()
87 StjTowerEnergyList listIn;
91 listIn.push_back(energy1);
95 listIn.push_back(energy2);
97 StjTowerEnergyList listExpected;
98 energy1.energy *= (1.0 - 0.05);
99 energy2.energy *= (1.0 - 0.05);
100 listExpected.push_back(energy1);
101 listExpected.push_back(energy2);
104 StjTowerEnergyList listActual = (*variation)(listIn);
107 CPPUNIT_ASSERT_EQUAL( listExpected, listActual );
112 void StjTowerEnergyListVariationTest::testEnergyPlus10()
118 StjTowerEnergyList listIn;
121 energy1.energy = 3.0;
122 listIn.push_back(energy1);
125 energy2.energy = 5.0;
126 listIn.push_back(energy2);
128 StjTowerEnergyList listExpected;
129 energy1.energy *= (1.0 + 0.1);
130 energy2.energy *= (1.0 + 0.1);
131 listExpected.push_back(energy1);
132 listExpected.push_back(energy2);
135 StjTowerEnergyList listActual = (*variation)(listIn);
138 CPPUNIT_ASSERT_EQUAL( listExpected, listActual );
143 void StjTowerEnergyListVariationTest::testEnergyMinus10()
149 StjTowerEnergyList listIn;
152 energy1.energy = 3.0;
153 listIn.push_back(energy1);
156 energy2.energy = 5.0;
157 listIn.push_back(energy2);
159 StjTowerEnergyList listExpected;
160 energy1.energy *= (1.0 - 0.1);
161 energy2.energy *= (1.0 - 0.1);
162 listExpected.push_back(energy1);
163 listExpected.push_back(energy2);
166 StjTowerEnergyList listActual = (*variation)(listIn);
169 CPPUNIT_ASSERT_EQUAL( listExpected, listActual );
175 void StjTowerEnergyListVariationTest::testEnergyNull()
179 StjTowerEnergyList listIn;
182 energy1.energy = 3.0;
183 listIn.push_back(energy1);
186 energy2.energy = 5.0;
187 listIn.push_back(energy2);
189 StjTowerEnergyList listExpected;
190 listExpected.push_back(energy1);
191 listExpected.push_back(energy2);
194 StjTowerEnergyList listActual = (*variation)(listIn);
197 CPPUNIT_ASSERT_EQUAL( listExpected, listActual );