33 {
34
35 BOOST_TEST_MESSAGE("Testing LegData Notionals...");
36
37 vector<double> notionals = {100, 200, 300};
38 vector<string> dates = {"", "2015-01-01", "2016-01-01"};
39
40 ScheduleRules sr(
"2014-06-01",
"2016-12-01",
"6M",
"TARGET",
"F",
"F",
"Forward");
42 BOOST_CHECK_EQUAL(s.size(), 6UL);
43
45
46
47 BOOST_CHECK_EQUAL(notionalsOut.size(), 5UL);
48 BOOST_CHECK_EQUAL(notionalsOut[0], 100);
49 BOOST_CHECK_EQUAL(notionalsOut[1], 100);
50 BOOST_CHECK_EQUAL(notionalsOut[2], 200);
51 BOOST_CHECK_EQUAL(notionalsOut[3], 200);
52 BOOST_CHECK_EQUAL(notionalsOut[4], 300);
53
54
55 notionals = vector<double>(1, 123);
57 BOOST_CHECK_EQUAL(notionalsOut.size(), 1UL);
58 BOOST_CHECK_EQUAL(notionalsOut[0], 123);
59
60
61 notionals = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
63 BOOST_CHECK_EQUAL(notionalsOut.size(), 10UL);
64 for (Size i = 0; i < notionalsOut.size(); i++) {
65 BOOST_CHECK_EQUAL(notionalsOut[i], (double)i);
66 }
67}
Serializable object holding schedule Rules data.
vector< T > buildScheduledVector(const vector< T > &values, const vector< string > &dates, const Schedule &schedule, const bool checkAllValuesAppearInResult=false)
Schedule makeSchedule(const ScheduleDates &data)