139 {
140
141 BOOST_TEST_MESSAGE("Testing FXSwap...");
142
143 QuantLib::ext::shared_ptr<Market> market = QuantLib::ext::make_shared<TestMarket>();
144
145 string nearDate = "2015-10-27";
146 string farDate = "2015-11-03";
147 string nearBoughtCurrency = "EUR";
148 Real nearBoughtAmount = 224557621.490000;
149 string nearSoldCurrency = "USD";
150 Real nearSoldAmount = 250000000.000000;
151 Real farBoughtAmount = 250018000.00;
152 Real farSoldAmount = 224552207.77;
153
154 test(nearDate, farDate, nearBoughtCurrency, nearBoughtAmount, nearSoldCurrency, nearSoldAmount, farBoughtAmount,
155 farSoldAmount, market);
156
157 nearDate = "2015-07-14";
158 farDate = "2015-11-16";
159 nearBoughtCurrency = "CHF";
160 nearBoughtAmount = 97000000;
161 nearSoldCurrency = "USD";
162 nearSoldAmount = 103718911.06;
163 farBoughtAmount = 103923787.150000;
164 farSoldAmount = 96737000.000000;
165
166 test(nearDate, farDate, nearBoughtCurrency, nearBoughtAmount, nearSoldCurrency, nearSoldAmount, farBoughtAmount,
167 farSoldAmount, market);
168
169 nearDate = "2015-08-04";
170 farDate = "2015-11-30";
171 nearBoughtCurrency = "GBP";
172 nearBoughtAmount = 100227439.19;
173 nearSoldCurrency = "USD";
174 nearSoldAmount = 156000000;
175 farBoughtAmount = 156148000.000000;
176 farSoldAmount = 100400372.110000;
177
178 test(nearDate, farDate, nearBoughtCurrency, nearBoughtAmount, nearSoldCurrency, nearSoldAmount, farBoughtAmount,
179 farSoldAmount, market);
180}