19#include <boost/test/unit_test.hpp>
21#include <oret/toplevelfixture.hpp>
23using namespace boost::unit_test_framework;
26BOOST_FIXTURE_TEST_SUITE(OREDataTestSuite, ore::test::TopLevelFixture)
28BOOST_AUTO_TEST_SUITE(FXDominanceTest)
31 BOOST_TEST_MESSAGE(
"Testing FXDominance...");
34 const char* expectedPairs[] = {
35 "EURUSD",
"GBPUSD",
"AUDUSD",
"CADJPY",
"AUDJPY",
"EURNOK",
"EURJPY",
"EURSEK",
"EURCHF",
"EURNOK",
"NOKJPY",
36 "NOKSEK",
"DKKSEK",
"CNYJPY",
"JPYIDR",
39 "AUDCAD",
"AUDCHF",
"AUDJPY",
"AUDNZD",
"AUDUSD",
"CADJPY",
"CADMXN",
"CADNOK",
"CHFJPY",
"EURAUD",
"EURCAD",
40 "EURCHF",
"EURCZK",
"EURDKK",
"EURGBP",
"EURHUF",
"EURJPY",
"EURKRW",
"EURMXN",
"EURNOK",
"EURNZD",
"EURPLN",
41 "EURRUB",
"EURSEK",
"EURTRY",
"EURUSD",
"EURZAR",
"GBPAUD",
"GBPCAD",
"GBPCHF",
"GBPJPY",
"GBPNOK",
"GBPUSD",
42 "JPYKRW",
"MXNJPY",
"NOKSEK",
"NZDCAD",
"NZDCHF",
"NZDJPY",
"NZDUSD",
"TRYJPY",
"USDCAD",
"USDCHF",
"USDCNH",
43 "USDCZK",
"USDDKK",
"USDHKD",
"USDHUF",
"USDILS",
"USDJPY",
"USDMXN",
"USDNOK",
"USDOMR",
"USDPLN",
"USDRON",
44 "USDRUB",
"USDSEK",
"USDSGD",
"USDTHB",
"USDTRY",
"USDZAR",
47 "XXXJPY",
"EURXXX",
"USDXXX",
50 "XAUUSD",
"XAGUSD",
"XPTUSD",
"XPDUSD",
"XAUEUR",
"XAGEUR",
"XPTAUD"};
52 for (
unsigned i = 0; i <
sizeof(expectedPairs) /
sizeof(expectedPairs[0]); i++) {
53 string expectedPair = expectedPairs[i];
54 string s1 = expectedPair.substr(0, 3);
55 string s2 = expectedPair.substr(3);
57 BOOST_TEST_MESSAGE(
"Combining " << s1 <<
" and " << s2 <<
" expecting " << expectedPair);
59 BOOST_CHECK_EQUAL(pair, expectedPair);
61 BOOST_TEST_MESSAGE(
"Combining " << s2 <<
" and " << s1 <<
" expecting " << expectedPair);
63 BOOST_CHECK_EQUAL(pair, expectedPair);
67BOOST_AUTO_TEST_SUITE_END()
69BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(testFXDominance)
string fxDominance(const string &s1, const string &s2)
Convert FX pair to market standard dominance.
Map text representations to QuantLib/QuantExt types.