/**
* Tests present value when the valuation date is on trade date.
*/
public void presentValueTrade() {
final ZonedDateTime referenceDate = DateUtils.getUTCDate(2011, 12, 12);
final DepositIbor deposit = DEPOSIT_IBOR_DEFINITION.toDerivative(referenceDate);
final MultipleCurrencyAmount pvComputed = METHOD_DEPOSIT.presentValue(deposit, PROVIDER_MULTICURVES);
final double dfEnd = PROVIDER_MULTICURVES.getDiscountFactor(deposit.getCurrency(), deposit.getEndTime());
final double forward = PROVIDER_MULTICURVES.getForwardRate(deposit.getIndex(), deposit.getStartTime(), deposit.getEndTime(), deposit.getAccrualFactor());
final double pvExpected = deposit.getAccrualFactor() * (deposit.getRate() - forward) * dfEnd;
assertEquals("DepositCounterpartDiscountingMethod: present value", pvExpected, pvComputed.getAmount(EUR), TOLERANCE_PV);
}