Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Namespaces | Functions
qle_calendars.cpp File Reference
#include "toplevelfixture.hpp"
#include <boost/test/unit_test.hpp>
#include <ql/time/calendar.hpp>
#include <ql/time/calendars/austria.hpp>
#include <ql/time/calendars/thailand.hpp>
#include <ql/time/calendars/chile.hpp>
#include <qle/calendars/belgium.hpp>
#include <qle/calendars/cyprus.hpp>
#include <qle/calendars/colombia.hpp>
#include <qle/calendars/france.hpp>
#include <qle/calendars/greece.hpp>
#include <qle/calendars/ireland.hpp>
#include <qle/calendars/israel.hpp>
#include <qle/calendars/luxembourg.hpp>
#include <qle/calendars/malaysia.hpp>
#include <qle/calendars/netherlands.hpp>
#include <qle/calendars/peru.hpp>
#include <qle/calendars/philippines.hpp>
#include <qle/calendars/spain.hpp>

Go to the source code of this file.

Namespaces

namespace  check
 

Functions

void checkCalendars (const std::vector< Date > &expectedHolidays, const std::vector< Date > &testHolidays)
 
 BOOST_AUTO_TEST_CASE (testPeruvianCalendar)
 
 BOOST_AUTO_TEST_CASE (testColombianCalendar)
 
 BOOST_AUTO_TEST_CASE (testPhilippineCalendar)
 
 BOOST_AUTO_TEST_CASE (testThaiCalendar)
 
 BOOST_AUTO_TEST_CASE (testMalaysianCalendar)
 
 BOOST_AUTO_TEST_CASE (testChileanCalendar)
 
 BOOST_AUTO_TEST_CASE (testNetherlandianCalendar)
 
 BOOST_AUTO_TEST_CASE (testFrenchCalendar)
 
 BOOST_AUTO_TEST_CASE (testIsraelTelbor)
 
 BOOST_AUTO_TEST_CASE (testIsraelTelAviv)
 
 BOOST_AUTO_TEST_CASE (testAustrianCalendar)
 
 BOOST_AUTO_TEST_CASE (testSpanishCalendar)
 
 BOOST_AUTO_TEST_CASE (testLuxembourgianCalendar)
 
 BOOST_AUTO_TEST_CASE (testBelgianCalendar)
 
 BOOST_AUTO_TEST_CASE (testCyprusCalendar)
 
 BOOST_AUTO_TEST_CASE (testGreeceCalendar)
 
 BOOST_AUTO_TEST_CASE (testIrishStockExchangeCalendar)
 
 BOOST_AUTO_TEST_CASE (testIrishBankHolidaysCalendar)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/18]

BOOST_AUTO_TEST_CASE ( testPeruvianCalendar  )

Definition at line 60 of file qle_calendars.cpp.

60 {
61
62 BOOST_TEST_MESSAGE("Testing Peruvian holiday list");
63
64 std::vector<Date> expectedHolidays;
65
66 expectedHolidays.push_back(Date(1, January, 2018));
67 expectedHolidays.push_back(Date(29, March, 2018));
68 expectedHolidays.push_back(Date(30, March, 2018));
69 expectedHolidays.push_back(Date(1, May, 2018));
70 expectedHolidays.push_back(Date(29, June, 2018));
71 expectedHolidays.push_back(Date(27, July, 2018));
72 expectedHolidays.push_back(Date(30, August, 2018));
73 expectedHolidays.push_back(Date(31, August, 2018));
74 expectedHolidays.push_back(Date(8, October, 2018));
75 expectedHolidays.push_back(Date(1, November, 2018));
76 expectedHolidays.push_back(Date(2, November, 2018));
77 expectedHolidays.push_back(Date(25, December, 2018));
78
79 Calendar c = Peru();
80
81 std::vector<Date> hol = c.holidayList(Date(1, January, 2018), Date(31, December, 2018));
82
83 BOOST_CHECK(hol.size() == expectedHolidays.size());
84
85 check::checkCalendars(expectedHolidays, hol);
86}
void checkCalendars(const std::vector< Date > &expectedHolidays, const std::vector< Date > &testHolidays)
+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [2/18]

BOOST_AUTO_TEST_CASE ( testColombianCalendar  )

Definition at line 88 of file qle_calendars.cpp.

88 {
89
90 BOOST_TEST_MESSAGE("Testing Colombian holiday list");
91
92 std::vector<Date> expectedHolidays;
93
94 expectedHolidays.push_back(Date(1, January, 2018));
95 expectedHolidays.push_back(Date(8, January, 2018));
96 expectedHolidays.push_back(Date(19, March, 2018));
97 expectedHolidays.push_back(Date(29, March, 2018));
98 expectedHolidays.push_back(Date(30, March, 2018));
99 expectedHolidays.push_back(Date(1, May, 2018));
100 expectedHolidays.push_back(Date(14, May, 2018));
101 expectedHolidays.push_back(Date(4, June, 2018));
102 expectedHolidays.push_back(Date(11, June, 2018));
103 expectedHolidays.push_back(Date(2, July, 2018));
104 expectedHolidays.push_back(Date(20, July, 2018));
105 expectedHolidays.push_back(Date(7, August, 2018));
106 expectedHolidays.push_back(Date(20, August, 2018));
107 expectedHolidays.push_back(Date(15, October, 2018));
108 expectedHolidays.push_back(Date(5, November, 2018));
109 expectedHolidays.push_back(Date(12, November, 2018));
110 expectedHolidays.push_back(Date(25, December, 2018));
111
112 Calendar c = Colombia();
113
114 std::vector<Date> hol = c.holidayList(Date(1, January, 2018), Date(31, December, 2018));
115
116 BOOST_CHECK(hol.size() == expectedHolidays.size());
117
118 check::checkCalendars(expectedHolidays, hol);
119}
+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [3/18]

BOOST_AUTO_TEST_CASE ( testPhilippineCalendar  )

Definition at line 121 of file qle_calendars.cpp.

121 {
122
123 BOOST_TEST_MESSAGE("Testing Philippine holiday list");
124
125 std::vector<Date> expectedHolidays;
126
127 expectedHolidays.push_back(Date(1, January, 2018));
128 expectedHolidays.push_back(Date(2, January, 2018));
129 expectedHolidays.push_back(Date(29, March, 2018));
130 expectedHolidays.push_back(Date(30, March, 2018));
131 expectedHolidays.push_back(Date(9, April, 2018));
132 expectedHolidays.push_back(Date(1, May, 2018));
133 expectedHolidays.push_back(Date(12, June, 2018));
134 expectedHolidays.push_back(Date(21, August, 2018));
135 expectedHolidays.push_back(Date(27, August, 2018));
136 expectedHolidays.push_back(Date(1, November, 2018));
137 expectedHolidays.push_back(Date(30, November, 2018));
138 expectedHolidays.push_back(Date(25, December, 2018));
139 expectedHolidays.push_back(Date(31, December, 2018));
140
141 Calendar c = Philippines();
142
143 std::vector<Date> hol = c.holidayList(Date(1, January, 2018), Date(31, December, 2018));
144
145 check::checkCalendars(expectedHolidays, hol);
146}
+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [4/18]

BOOST_AUTO_TEST_CASE ( testThaiCalendar  )

Definition at line 148 of file qle_calendars.cpp.

148 {
149
150 BOOST_TEST_MESSAGE("Testing Thai holiday list");
151
152 std::vector<Date> expectedHolidays;
153
154 expectedHolidays.push_back(Date(1, January, 2018));
155 expectedHolidays.push_back(Date(2, January, 2018));
156 expectedHolidays.push_back(Date(1, March, 2018)); // Makha Bucha Day
157 expectedHolidays.push_back(Date(6, April, 2018));
158 expectedHolidays.push_back(Date(13, April, 2018));
159 expectedHolidays.push_back(Date(16, April, 2018));
160 expectedHolidays.push_back(Date(1, May, 2018));
161 expectedHolidays.push_back(Date(29, May, 2018)); // Wisakha Bucha Day
162 expectedHolidays.push_back(Date(27, July, 2018)); // Asarnha Bucha Day
163 expectedHolidays.push_back(Date(30, July, 2018));
164 expectedHolidays.push_back(Date(13, August, 2018));
165 expectedHolidays.push_back(Date(15, October, 2018));
166 expectedHolidays.push_back(Date(23, October, 2018));
167 expectedHolidays.push_back(Date(5, December, 2018));
168 expectedHolidays.push_back(Date(10, December, 2018));
169 expectedHolidays.push_back(Date(31, December, 2018));
170
171 Calendar c = Thailand();
172
173 std::vector<Date> hol = c.holidayList(Date(1, January, 2018), Date(31, December, 2018));
174
175 BOOST_CHECK(hol.size() == expectedHolidays.size());
176
177 check::checkCalendars(expectedHolidays, hol);
178}
+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [5/18]

BOOST_AUTO_TEST_CASE ( testMalaysianCalendar  )

Definition at line 180 of file qle_calendars.cpp.

180 {
181
182 BOOST_TEST_MESSAGE("Testing Malaysian holiday list");
183
184 std::vector<Date> expectedHolidays;
185
186 expectedHolidays.push_back(Date(1, January, 2018));
187 expectedHolidays.push_back(Date(1, February, 2018));
188 expectedHolidays.push_back(Date(1, May, 2018));
189 expectedHolidays.push_back(Date(31, August, 2018));
190 expectedHolidays.push_back(Date(17, September, 2018));
191 expectedHolidays.push_back(Date(25, December, 2018));
192
193 Calendar c = Malaysia();
194
195 std::vector<Date> hol = c.holidayList(Date(1, January, 2018), Date(31, December, 2018));
196
197 BOOST_CHECK(hol.size() == expectedHolidays.size());
198
199 check::checkCalendars(expectedHolidays, hol);
200}
+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [6/18]

BOOST_AUTO_TEST_CASE ( testChileanCalendar  )

Definition at line 202 of file qle_calendars.cpp.

202 {
203
204 BOOST_TEST_MESSAGE("Testing Chilean holiday list");
205
206 std::vector<Date> expectedHolidays;
207
208 expectedHolidays.push_back(Date(1, January, 2018));
209 expectedHolidays.push_back(Date(30, March, 2018));
210 expectedHolidays.push_back(Date(1, May, 2018));
211 expectedHolidays.push_back(Date(21, May, 2018));
212 expectedHolidays.push_back(Date(2, July, 2018));
213 expectedHolidays.push_back(Date(16, July, 2018));
214 expectedHolidays.push_back(Date(15, August, 2018));
215 expectedHolidays.push_back(Date(17, September, 2018));
216 expectedHolidays.push_back(Date(18, September, 2018));
217 expectedHolidays.push_back(Date(19, September, 2018));
218 expectedHolidays.push_back(Date(15, October, 2018));
219 expectedHolidays.push_back(Date(1, November, 2018));
220 expectedHolidays.push_back(Date(2, November, 2018));
221 expectedHolidays.push_back(Date(25, December, 2018));
222
223 Calendar c = Chile();
224
225 std::vector<Date> hol = c.holidayList(Date(1, January, 2018), Date(31, December, 2018));
226
227 BOOST_CHECK(hol.size() == expectedHolidays.size());
228
229 check::checkCalendars(expectedHolidays, hol);
230}
+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [7/18]

BOOST_AUTO_TEST_CASE ( testNetherlandianCalendar  )

Definition at line 232 of file qle_calendars.cpp.

232 {
233
234 BOOST_TEST_MESSAGE("Testing Netherlandian holiday list");
235
236 std::vector<Date> expectedHolidays;
237
238 expectedHolidays.push_back(Date(1, January, 2018));
239 expectedHolidays.push_back(Date(30, March, 2018));
240 expectedHolidays.push_back(Date(2, April, 2018));
241 expectedHolidays.push_back(Date(27, April, 2018));
242 expectedHolidays.push_back(Date(10, May, 2018));
243 expectedHolidays.push_back(Date(21, May, 2018));
244 expectedHolidays.push_back(Date(25, December, 2018));
245 expectedHolidays.push_back(Date(26, December, 2018));
246
247 Calendar c = Netherlands();
248
249 std::vector<Date> hol = c.holidayList(Date(1, January, 2018), Date(31, December, 2018));
250
251 BOOST_CHECK(hol.size() == expectedHolidays.size());
252
253 check::checkCalendars(expectedHolidays, hol);
254}
+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [8/18]

BOOST_AUTO_TEST_CASE ( testFrenchCalendar  )

Definition at line 256 of file qle_calendars.cpp.

256 {
257
258 BOOST_TEST_MESSAGE("Testing French holiday list");
259
260 std::vector<Date> expectedHolidays;
261
262 expectedHolidays.push_back(Date(1, January, 2018));
263 expectedHolidays.push_back(Date(30, March, 2018));
264 expectedHolidays.push_back(Date(2, April, 2018));
265 expectedHolidays.push_back(Date(1, May, 2018));
266 expectedHolidays.push_back(Date(8, May, 2018));
267 expectedHolidays.push_back(Date(10, May, 2018));
268 expectedHolidays.push_back(Date(21, May, 2018));
269 expectedHolidays.push_back(Date(15, August, 2018));
270 expectedHolidays.push_back(Date(1, November, 2018));
271 expectedHolidays.push_back(Date(25, December, 2018));
272 expectedHolidays.push_back(Date(26, December, 2018));
273
274 Calendar c = France();
275
276 std::vector<Date> hol = c.holidayList(Date(1, January, 2018), Date(31, December, 2018));
277
278 BOOST_CHECK(hol.size() == expectedHolidays.size());
279
280 check::checkCalendars(expectedHolidays, hol);
281}
+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [9/18]

BOOST_AUTO_TEST_CASE ( testIsraelTelbor  )

Definition at line 283 of file qle_calendars.cpp.

283 {
284
285 BOOST_TEST_MESSAGE("Testing Israel Telbor standard weekends");
286
288
289 BOOST_CHECK(!c.isWeekend(Friday));
290 BOOST_CHECK(c.isWeekend(Saturday));
291 BOOST_CHECK(c.isWeekend(Sunday));
292}
Israel calendar.
Definition: israel.hpp:40

◆ BOOST_AUTO_TEST_CASE() [10/18]

BOOST_AUTO_TEST_CASE ( testIsraelTelAviv  )

Definition at line 294 of file qle_calendars.cpp.

294 {
295
296 BOOST_TEST_MESSAGE("Testing Israel TelAviv weekends");
297
299
300 BOOST_CHECK(c.isWeekend(Friday));
301 BOOST_CHECK(c.isWeekend(Saturday));
302 BOOST_CHECK(!c.isWeekend(Sunday));
303}

◆ BOOST_AUTO_TEST_CASE() [11/18]

BOOST_AUTO_TEST_CASE ( testAustrianCalendar  )

Definition at line 305 of file qle_calendars.cpp.

305 {
306
307 BOOST_TEST_MESSAGE("Testing Austrian holiday list");
308
309 std::vector<Date> expectedHolidays;
310
311 expectedHolidays.push_back(Date(1, January, 2020));
312 expectedHolidays.push_back(Date(6, January, 2020));
313 expectedHolidays.push_back(Date(13, April, 2020));
314 expectedHolidays.push_back(Date(1, May, 2020));
315 expectedHolidays.push_back(Date(21, May, 2020));
316 expectedHolidays.push_back(Date(1, June, 2020));
317 expectedHolidays.push_back(Date(11, June, 2020));
318 // expectedHolidays.push_back(Date(15, August, 2020)); //Saturday
319 expectedHolidays.push_back(Date(26, October, 2020));
320 // expectedHolidays.push_back(Date(1, November, 2020)); //Sunday
321 expectedHolidays.push_back(Date(8, December, 2020));
322 expectedHolidays.push_back(Date(25, December, 2020));
323 // expectedHolidays.push_back(Date(26, December, 2020)); //Saturday
324
325 Calendar c = Austria();
326
327 std::vector<Date> hol = c.holidayList(Date(1, January, 2020), Date(31, December, 2020));
328
329 BOOST_CHECK(hol.size() == expectedHolidays.size());
330
331 check::checkCalendars(expectedHolidays, hol);
332}
+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [12/18]

BOOST_AUTO_TEST_CASE ( testSpanishCalendar  )

Definition at line 334 of file qle_calendars.cpp.

334 {
335
336 BOOST_TEST_MESSAGE("Testing Spanish holiday list");
337
338 std::vector<Date> expectedHolidays;
339
340 expectedHolidays.push_back(Date(1, January, 2020));
341 expectedHolidays.push_back(Date(6, January, 2020));
342 expectedHolidays.push_back(Date(10, April, 2020));
343 expectedHolidays.push_back(Date(1, May, 2020));
344 // expectedHolidays.push_back(Date(15, August, 2020)); //Saturday
345 expectedHolidays.push_back(Date(12, October, 2020));
346 // expectedHolidays.push_back(Date(1, November, 2020)); //Sunday
347 // expectedHolidays.push_back(Date(6, December, 2020)); //Sunday
348 expectedHolidays.push_back(Date(8, December, 2020));
349 expectedHolidays.push_back(Date(25, December, 2020));
350
351 Calendar c = Spain();
352
353 std::vector<Date> hol = c.holidayList(Date(1, January, 2020), Date(31, December, 2020));
354
355 BOOST_CHECK(hol.size() == expectedHolidays.size());
356
357 check::checkCalendars(expectedHolidays, hol);
358}
+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [13/18]

BOOST_AUTO_TEST_CASE ( testLuxembourgianCalendar  )

Definition at line 360 of file qle_calendars.cpp.

360 {
361
362 BOOST_TEST_MESSAGE("Testing Luxembourgian holiday list");
363
364 std::vector<Date> expectedHolidays;
365
366 expectedHolidays.push_back(Date(1, January, 2020));
367 expectedHolidays.push_back(Date(13, April, 2020));
368 expectedHolidays.push_back(Date(1, May, 2020));
369 // expectedHolidays.push_back(Date(9, May, 2020)); //Saturday
370 expectedHolidays.push_back(Date(21, May, 2020));
371 expectedHolidays.push_back(Date(1, June, 2020));
372 expectedHolidays.push_back(Date(23, June, 2020));
373 // expectedHolidays.push_back(Date(15, August, 2020)); //Saturday
374 // expectedHolidays.push_back(Date(1, November, 2020)); //Sunday
375 expectedHolidays.push_back(Date(25, December, 2020));
376 // expectedHolidays.push_back(Date(26, December, 2020)); //Saturday
377
378 Calendar c = Luxembourg();
379
380 std::vector<Date> hol = c.holidayList(Date(1, January, 2020), Date(31, December, 2020));
381
382 BOOST_CHECK(hol.size() == expectedHolidays.size());
383
384 check::checkCalendars(expectedHolidays, hol);
385}
+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [14/18]

BOOST_AUTO_TEST_CASE ( testBelgianCalendar  )

Definition at line 387 of file qle_calendars.cpp.

387 {
388
389 BOOST_TEST_MESSAGE("Testing Belgian holiday list");
390
391 std::vector<Date> expectedHolidays;
392
393 expectedHolidays.push_back(Date(1, January, 2020));
394 // expectedHolidays.push_back(Date(12, April, 2020)); //Sunday
395 expectedHolidays.push_back(Date(13, April, 2020));
396 expectedHolidays.push_back(Date(1, May, 2020));
397 expectedHolidays.push_back(Date(21, May, 2020));
398 // expectedHolidays.push_back(Date(31, May, 2020)); //Sunday
399 expectedHolidays.push_back(Date(1, June, 2020));
400 expectedHolidays.push_back(Date(21, July, 2020));
401 // expectedHolidays.push_back(Date(15, August, 2020)); //Saturday
402 // expectedHolidays.push_back(Date(1, November, 2020)); //Sunday
403 expectedHolidays.push_back(Date(11, November, 2020));
404 expectedHolidays.push_back(Date(25, December, 2020));
405
406 Calendar c = Belgium();
407
408 std::vector<Date> hol = c.holidayList(Date(1, January, 2020), Date(31, December, 2020));
409
410 BOOST_CHECK(hol.size() == expectedHolidays.size());
411
412 check::checkCalendars(expectedHolidays, hol);
413}
+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [15/18]

BOOST_AUTO_TEST_CASE ( testCyprusCalendar  )

Definition at line 415 of file qle_calendars.cpp.

415 {
416
417 BOOST_TEST_MESSAGE("Testing Cyprus holiday list");
418
419 std::vector<Date> expectedHolidays;
420
421 //expectedHolidays.push_back(Date(1, January, 2022)); //weekend
422 expectedHolidays.push_back(Date(6, January, 2022));
423 expectedHolidays.push_back(Date(7, March, 2022));
424 expectedHolidays.push_back(Date(25, March, 2022));
425 expectedHolidays.push_back(Date(1, April, 2022));
426 expectedHolidays.push_back(Date(22, April, 2022));
427 expectedHolidays.push_back(Date(25, April, 2022));
428 expectedHolidays.push_back(Date(26, April, 2022));
429 //expectedHolidays.push_back(Date(1, May, 2022)); //weekend
430 expectedHolidays.push_back(Date(13, June, 2022));
431 expectedHolidays.push_back(Date(15, August, 2022));
432 //expectedHolidays.push_back(Date(1, October, 2022)); weekend
433 expectedHolidays.push_back(Date(28, October, 2022));
434 //expectedHolidays.push_back(Date(25, December, 2022));weekend
435 expectedHolidays.push_back(Date(26, December, 2022));
436
437 Calendar c = Cyprus();
438
439 std::vector<Date> hol = c.holidayList(Date(1, January, 2022), Date(31, December, 2022));
440
441 BOOST_CHECK(hol.size() == expectedHolidays.size());
442
443 check::checkCalendars(expectedHolidays, hol);
444}
Cyprus Calendar.
Definition: cyprus.hpp:62
+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [16/18]

BOOST_AUTO_TEST_CASE ( testGreeceCalendar  )

Definition at line 446 of file qle_calendars.cpp.

446 {
447
448 BOOST_TEST_MESSAGE("Testing Greece holiday list");
449
450 std::vector<Date> expectedHolidays;
451
452 expectedHolidays.push_back(Date(1, January, 2021));
453 expectedHolidays.push_back(Date(6, January, 2021));
454 expectedHolidays.push_back(Date(15, March, 2021));
455 expectedHolidays.push_back(Date(25, March, 2021));
456 expectedHolidays.push_back(Date(30, April, 2021));
457 expectedHolidays.push_back(Date(3, May, 2021));
458 expectedHolidays.push_back(Date(4, May, 2021));
459 expectedHolidays.push_back(Date(21, June, 2021));
460 expectedHolidays.push_back(Date(28, October, 2021));
461
462 expectedHolidays.push_back(Date(6, January, 2022));
463 expectedHolidays.push_back(Date(7, March, 2022));
464 expectedHolidays.push_back(Date(25, March, 2022));
465 expectedHolidays.push_back(Date(22, April, 2022));
466 expectedHolidays.push_back(Date(25, April, 2022));
467 expectedHolidays.push_back(Date(13, June, 2022));
468 expectedHolidays.push_back(Date(15, August, 2022));
469 expectedHolidays.push_back(Date(28, October, 2022));
470 expectedHolidays.push_back(Date(26, December, 2022));
471
472
473
474 Calendar c = Greece();
475
476 std::vector<Date> hol = c.holidayList(Date(1, January, 2021), Date(31, December, 2022));
477
478 BOOST_CHECK(hol.size() == expectedHolidays.size());
479
480 check::checkCalendars(expectedHolidays, hol);
481}
Greece Calendar.
Definition: greece.hpp:57
+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [17/18]

BOOST_AUTO_TEST_CASE ( testIrishStockExchangeCalendar  )

Definition at line 483 of file qle_calendars.cpp.

483 {
484
485 BOOST_TEST_MESSAGE("Testing Irish Stock Exchange holiday list");
486
487 std::vector<Date> expectedHolidays;
488
489 expectedHolidays.push_back(Date(1, January, 2021));
490 expectedHolidays.push_back(Date(17, March, 2021));
491 expectedHolidays.push_back(Date(2, April, 2021));
492 expectedHolidays.push_back(Date(5, April, 2021));
493 expectedHolidays.push_back(Date(3, May, 2021));
494 expectedHolidays.push_back(Date(7, June, 2021));
495 expectedHolidays.push_back(Date(2, August, 2021));
496 expectedHolidays.push_back(Date(25, October, 2021));
497 //expectedHolidays.push_back(Date(25, December, 2021)); Falls on weekend
498 //expectedHolidays.push_back(Date(26, December, 2021)); Falls on weekend
499 expectedHolidays.push_back(Date(27, December, 2021));
500 expectedHolidays.push_back(Date(28, December, 2021));
501
502 Calendar c = Ireland();
503
504 std::vector<Date> hol = c.holidayList(Date(1, January, 2021), Date(31, December, 2021));
505
506 BOOST_CHECK(hol.size() == expectedHolidays.size());
507
508 check::checkCalendars(expectedHolidays, hol);
509}
Ireland Calendars.
Definition: ireland.hpp:54
+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [18/18]

BOOST_AUTO_TEST_CASE ( testIrishBankHolidaysCalendar  )

Definition at line 511 of file qle_calendars.cpp.

511 {
512
513 BOOST_TEST_MESSAGE("Testing Irish bank holiday list");
514
515 std::vector<Date> expectedHolidays;
516
517 expectedHolidays.push_back(Date(1, January, 2021));
518 expectedHolidays.push_back(Date(17, March, 2021));
519 expectedHolidays.push_back(Date(2, April, 2021));
520 expectedHolidays.push_back(Date(5, April, 2021));
521 expectedHolidays.push_back(Date(3, May, 2021));
522 expectedHolidays.push_back(Date(7, June, 2021));
523 expectedHolidays.push_back(Date(2, August, 2021));
524 expectedHolidays.push_back(Date(25, October, 2021));
525 // expectedHolidays.push_back(Date(25, December, 2021)); Falls on weekend
526 // expectedHolidays.push_back(Date(26, December, 2021)); Falls on weekend
527 expectedHolidays.push_back(Date(27, December, 2021));
528 expectedHolidays.push_back(Date(28, December, 2021));
529 expectedHolidays.push_back(Date(29, December, 2021));
530
531 Calendar c = Ireland(Ireland::BankHolidays);
532
533 std::vector<Date> hol = c.holidayList(Date(1, January, 2021), Date(31, December, 2021));
534
535 BOOST_CHECK(hol.size() == expectedHolidays.size());
536
537 check::checkCalendars(expectedHolidays, hol);
538}
+ Here is the call graph for this function: