public void test_positive_offset() { assertThrows(() -> Bill.builder() .dayCount(DAY_COUNT) .legalEntityId(LEGAL_ENTITY) .notional(NOTIONAL) .securityId(SECURITY_ID) .settlementDateOffset(DaysAdjustment.ofBusinessDays(-11, USNY, BUSINESS_ADJUST)) .yieldConvention(YIELD_CONVENTION).build()); }
public void test_positive_notional() { assertThrows(() -> Bill.builder() .dayCount(DAY_COUNT) .legalEntityId(LEGAL_ENTITY) .notional(AdjustablePayment.of(CurrencyAmount.of(CCY, -10), MATURITY_DATE_ADJ)) .securityId(SECURITY_ID) .settlementDateOffset(SETTLE) .yieldConvention(YIELD_CONVENTION).build()); }
public void test_createProduct() { BillSecurity base = BillSecurity.builder() .dayCount(DAY_COUNT) .info(INFO) .legalEntityId(LEGAL_ENTITY) .notional(NOTIONAL) .settlementDateOffset(SETTLE) .yieldConvention(YIELD_CONVENTION) .build(); Bill expectedProduct = Bill.builder() .dayCount(DAY_COUNT) .securityId(SECURITY_ID) .dayCount(DAY_COUNT) .legalEntityId(LEGAL_ENTITY) .notional(NOTIONAL) .settlementDateOffset(SETTLE) .yieldConvention(YIELD_CONVENTION) .build(); assertEquals(base.createProduct(ReferenceData.empty()), expectedProduct); TradeInfo tradeInfo = TradeInfo.of(date(2016, 6, 30)); BillTrade expectedTrade = BillTrade.builder() .info(tradeInfo) .product(expectedProduct) .quantity(100) .price(1.235) .build(); assertEquals(base.createTrade(tradeInfo, 100, 1.235, ReferenceData.empty()), expectedTrade); }
.yieldConvention(YIELD_CONVENTION) .build(); Bill product = Bill.builder() .dayCount(DAY_COUNT) .securityId(SECURITY_ID)