Exemplo n.º 1
0
        //-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            Payment           settle   = Payment.of(PRODUCT.Notional.Value.multipliedBy(-PRICE * QUANTITY), SETTLEMENT_DATE);
            ResolvedBillTrade expected = ResolvedBillTrade.builder().info(TRADE_INFO).product(PRODUCT.resolve(REF_DATA)).quantity(QUANTITY).settlement(settle).build();

            assertEquals(sut_price().resolve(REF_DATA), expected);
        }
Exemplo n.º 2
0
        public virtual void test_resolve()
        {
            BillPosition      @base    = BillPosition.builder().info(POSITION_INFO1).product(PRODUCT1).longQuantity(QUANTITY1).build();
            ResolvedBillTrade computed = @base.resolve(REF_DATA);
            ResolvedBillTrade expected = ResolvedBillTrade.builder().info(POSITION_INFO1).product(PRODUCT1.resolve(REF_DATA)).quantity(QUANTITY1).build();

            assertEquals(computed, expected);
        }
Exemplo n.º 3
0
        public ResolvedBillTrade resolve(ReferenceData refData)
        {
            ResolvedBill   resolvedProduct = product.resolve(refData);
            CurrencyAmount settleAmount    = product.Notional.Value.multipliedBy(-price * quantity);
            LocalDate      settlementDate  = calculateSettlementDate(refData);
            Payment        settlement      = Payment.of(settleAmount, settlementDate);

            return(ResolvedBillTrade.builder().info(info).product(resolvedProduct).quantity(quantity).settlement(settlement).build());
        }
 public virtual void test_builder_quantitySettlement()
 {
     assertThrows(() => ResolvedBillTrade.builder().info(TradeInfo.of(date(2015, 3, 25))).product(ResolvedBillTest.sut()).quantity(123).settlement(Payment.of(Currency.USD, 120, date(2015, 3, 27))).build());
 }