@Test
/**
* Tests the builders.
*/
public void from() {
final CashDefinition fromTradeTenor = CashDefinition.fromTrade(TRADE_DATE, DEPOSIT_PERIOD, NOTIONAL, RATE, GENERATOR);
assertEquals("CashDefinition: from", DEPOSIT_DEFINITION, fromTradeTenor);
final CashDefinition fromStartTenor = CashDefinition.fromStart(SPOT_DATE, DEPOSIT_PERIOD, NOTIONAL, RATE, GENERATOR);
assertEquals("CashDefinition: from", DEPOSIT_DEFINITION, fromStartTenor);
final int start = 1;
final ZonedDateTime startDate = ScheduleCalculator.getAdjustedDate(TRADE_DATE, start, TARGET);
final ZonedDateTime endDate = ScheduleCalculator.getAdjustedDate(startDate, 1, TARGET);
final double af = GENERATOR.getDayCount().getDayCountFraction(startDate, endDate);
final CashDefinition on = new CashDefinition(EUR, startDate, endDate, NOTIONAL, RATE, af);
final CashDefinition fromTradeON = CashDefinition.fromTrade(TRADE_DATE, start, NOTIONAL, RATE, GENERATOR);
assertEquals("CashDefinition: from", on, fromTradeON);
final CashDefinition fromStartON = CashDefinition.fromStart(startDate, NOTIONAL, RATE, GENERATOR);
assertEquals("CashDefinition: from", on, fromStartON);
}