126 {
127
128
129 string referenceEntityId = "RED:2H6677";
130 CdsTier tier = CdsTier::SNRFOR;
131 Currency currency = EURCurrency();
134
135
137
138
139 BOOST_CHECK_EQUAL(cdsData.issuerId(), "DB");
140 BOOST_CHECK(cdsData.settlesAccrual());
141 BOOST_CHECK_EQUAL(cdsData.protectionPaymentTime(), QuantExt::CreditDefaultSwap::ProtectionPaymentTime::atDefault);
142 BOOST_CHECK_EQUAL(cdsData.protectionStart(), Date());
143 BOOST_CHECK_EQUAL(cdsData.upfrontDate(), Date());
144 BOOST_CHECK_EQUAL(cdsData.upfrontFee(), Null<Real>());
145 BOOST_CHECK_EQUAL(cdsData.recoveryRate(), Null<Real>());
146 BOOST_CHECK(cdsData.referenceObligation().empty());
147
148
149 BOOST_CHECK_EQUAL(cdsData.creditCurveId(), referenceInfo.id());
150 BOOST_CHECK(cdsData.referenceInformation());
151 BOOST_CHECK_EQUAL(referenceInfo.referenceEntityId(), cdsData.referenceInformation()->referenceEntityId());
152 BOOST_CHECK_EQUAL(referenceInfo.tier(), cdsData.referenceInformation()->tier());
153 BOOST_CHECK_EQUAL(referenceInfo.currency(), cdsData.referenceInformation()->currency());
154 BOOST_CHECK_EQUAL(referenceInfo.docClause(), cdsData.referenceInformation()->docClause());
155 BOOST_CHECK_EQUAL(referenceInfo.id(), cdsData.referenceInformation()->id());
156
157
158 string xmlStr = cdsData.toXMLString();
159
160
163
164
165 BOOST_CHECK_EQUAL(cdsData.issuerId(), xmlCdsData.
issuerId());
166 BOOST_CHECK_EQUAL(cdsData.settlesAccrual(), xmlCdsData.
settlesAccrual());
168 BOOST_CHECK_EQUAL(cdsData.protectionStart(), xmlCdsData.
protectionStart());
169 BOOST_CHECK_EQUAL(cdsData.upfrontDate(), xmlCdsData.
upfrontDate());
170 BOOST_CHECK_EQUAL(cdsData.upfrontFee(), xmlCdsData.
upfrontFee());
171 BOOST_CHECK_EQUAL(cdsData.recoveryRate(), xmlCdsData.
recoveryRate());
173 BOOST_CHECK_EQUAL(cdsData.creditCurveId(), xmlCdsData.
creditCurveId());
175 BOOST_CHECK_EQUAL(referenceInfo.referenceEntityId(), xmlCdsData.
referenceInformation()->referenceEntityId());
180}
const boost::optional< CdsReferenceInformation > & referenceInformation() const