@Test
/**
* Tests the builders.
*/
public void from() {
final DepositCounterpartDefinition fromTradeTenor = DepositCounterpartDefinition.fromTrade(TRADE_DATE, DEPOSIT_PERIOD, NOTIONAL, RATE, GENERATOR, COUNTERPART);
assertEquals("DepositDefinition: from", DEPOSIT_CTP_DEFINITION, fromTradeTenor);
final DepositCounterpartDefinition fromStartTenor = DepositCounterpartDefinition.fromStart(SPOT_DATE, DEPOSIT_PERIOD, NOTIONAL, RATE, GENERATOR, COUNTERPART);
assertEquals("DepositDefinition: from", DEPOSIT_CTP_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 DepositCounterpartDefinition on = new DepositCounterpartDefinition(EUR, startDate, endDate, NOTIONAL, RATE, af, COUNTERPART);
final DepositCounterpartDefinition fromTradeON = DepositCounterpartDefinition.fromTrade(TRADE_DATE, start, NOTIONAL, RATE, GENERATOR, COUNTERPART);
assertEquals("DepositDefinition: from", on, fromTradeON);
final DepositCounterpartDefinition fromStartON = DepositCounterpartDefinition.fromStart(startDate, NOTIONAL, RATE, GENERATOR, COUNTERPART);
assertEquals("DepositDefinition: from", on, fromStartON);
}