Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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());
        }
Ejemplo n.º 4
0
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         ResolvedBillTrade other = (ResolvedBillTrade)obj;
         return(JodaBeanUtils.equal(info, other.info) && JodaBeanUtils.equal(product, other.product) && JodaBeanUtils.equal(quantity, other.quantity) && JodaBeanUtils.equal(settlement, other.settlement));
     }
     return(false);
 }
 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());
 }
        //-------------------------------------------------------------------------
        public virtual void test_builder()
        {
            ResolvedBillTrade test = sut();

            assertEquals(test.Settlement.Present, true);
        }