34 {
35
36 BOOST_TEST_MESSAGE("Testing RussiaModified calendar");
37
38 Calendar russiaSettlement = Russia(Russia::Settlement);
39 Calendar russiaExchange = Russia(Russia::MOEX);
40 Calendar russiaModifiedSettlement =
RussiaModified(Russia::Settlement);
42
43
44 Date pre(31, December, 2011);
45 BOOST_CHECK_THROW(russiaExchange.isBusinessDay(pre), QuantLib::Error);
46 BOOST_CHECK_NO_THROW(russiaModifiedExchange.isBusinessDay(pre));
47
48
49 Date start2011(1, Jan, 2011);
50 Date end2011(31, Dec, 2011);
51 for(Date d = start2011; d <= end2011; d++) {
52 BOOST_CHECK_EQUAL(russiaSettlement.isBusinessDay(d), russiaModifiedSettlement.isBusinessDay(d));
53 BOOST_CHECK_EQUAL(russiaSettlement.isBusinessDay(d), russiaModifiedExchange.isBusinessDay(d));
54 }
55
56
57 Date start2012(1, Jan, 2012);
58 Date end2012(31, Dec, 2012);
59 for(Date d = start2012; d <= end2012; d++) {
60 BOOST_CHECK_EQUAL(russiaSettlement.isBusinessDay(d), russiaModifiedSettlement.isBusinessDay(d));
61 BOOST_CHECK_EQUAL(russiaExchange.isBusinessDay(d), russiaModifiedExchange.isBusinessDay(d));
62 }
63}