31 {
33
34
35 BOOST_CHECK_THROW(
data.set(3, 0, 0.0, AggregationScenarioDataType::Generic,
"blabla"), std::exception);
36 BOOST_CHECK_THROW(
data.set(0, 5, 0.0, AggregationScenarioDataType::Generic,
"blabla"), std::exception);
37
38 for (Size i = 0; i < 3; ++i) {
39 for (Size j = 0; j < 5; ++j) {
40 data.set(i, j, 0.0001 * i + 0.01 * j, AggregationScenarioDataType::IndexFixing,
"OIS_EUR");
41 data.set(i, j, 0.1 + 0.0001 * i + 0.01 * j, AggregationScenarioDataType::IndexFixing,
"OIS_USD");
42 data.set(i, j, 0.2 + 0.0001 * i + 0.01 * j, AggregationScenarioDataType::IndexFixing,
"OIS_GBP");
43 data.set(i, j, i + 0.1 * j, AggregationScenarioDataType::FXSpot,
"EURUSD");
44 data.set(i, j, 2.0 + i + 0.1 * j, AggregationScenarioDataType::FXSpot,
"EURGBP");
45 }
46 }
47
48
49 BOOST_CHECK_THROW(
data.get(3, 0, AggregationScenarioDataType::Generic,
"blabla"), std::exception);
50 BOOST_CHECK_THROW(
data.get(0, 5, AggregationScenarioDataType::Generic,
"blabla"), std::exception);
51
53
54 for (Size i = 0; i < 3; ++i) {
55 for (Size j = 0; j < 5; ++j) {
56 BOOST_CHECK_CLOSE(
data.get(i, j, AggregationScenarioDataType::IndexFixing,
"OIS_EUR"),
57 0.0001 * i + 0.01 * j,
tol);
58 BOOST_CHECK_CLOSE(
data.get(i, j, AggregationScenarioDataType::IndexFixing,
"OIS_USD"),
59 0.1 + 0.0001 * i + 0.01 * j,
tol);
60 BOOST_CHECK_CLOSE(
data.get(i, j, AggregationScenarioDataType::IndexFixing,
"OIS_GBP"),
61 0.2 + 0.0001 * i + 0.01 * j,
tol);
62 BOOST_CHECK_CLOSE(
data.get(i, j, AggregationScenarioDataType::FXSpot,
"EURUSD"), i + 0.1 * j,
tol);
63 BOOST_CHECK_CLOSE(
data.get(i, j, AggregationScenarioDataType::FXSpot,
"EURGBP"), 2.0 + i + 0.1 * j,
tol);
64 }
65 }
66}
A concrete in memory implementation of AggregationScenarioData.