19#include <boost/test/unit_test.hpp>
21#include <oret/toplevelfixture.hpp>
25using namespace boost::unit_test_framework;
29BOOST_AUTO_TEST_SUITE(AggregationScenarioDataTest)
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);
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");
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);
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);
68BOOST_AUTO_TEST_SUITE_END()
70BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(testInMemoryAggregationScenarioData)
this class holds data associated to scenarios
A concrete in memory implementation of AggregationScenarioData.
OREAnalytics Top level fixture.
Fixture that can be used at top level of OREAnalytics test suites.