Example #1
0
        //-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            OvernightFuturePosition      @base    = OvernightFuturePosition.builder().info(POSITION_INFO).product(PRODUCT).longQuantity(QUANTITY).build();
            ResolvedOvernightFutureTrade expected = ResolvedOvernightFutureTrade.builder().info(POSITION_INFO).product(PRODUCT.resolve(REF_DATA)).quantity(QUANTITY).build();

            assertEquals(@base.resolve(REF_DATA), expected);
        }
Example #2
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            ResolvedOvernightFutureTrade test1 = ResolvedOvernightFutureTrade.builder().info(TRADE_INFO).product(PRODUCT).quantity(QUANTITY).tradedPrice(TradedPrice.of(TRADE_DATE, PRICE)).build();

            coverImmutableBean(test1);
            ResolvedOvernightFutureTrade test2 = ResolvedOvernightFutureTrade.builder().info(TradeInfo.empty()).product(PRODUCT2).quantity(QUANTITY2).tradedPrice(TradedPrice.of(TRADE_DATE, PRICE2)).build();

            coverBeanEquals(test1, test2);
        }
Example #3
0
        //-------------------------------------------------------------------------
        public virtual void test_builder()
        {
            ResolvedOvernightFutureTrade test = ResolvedOvernightFutureTrade.builder().info(TRADE_INFO).product(PRODUCT).quantity(QUANTITY).tradedPrice(TradedPrice.of(TRADE_DATE, PRICE)).build();

            assertEquals(test.Info, TRADE_INFO);
            assertEquals(test.Product, PRODUCT);
            assertEquals(test.Quantity, QUANTITY);
            assertEquals(test.TradedPrice, TradedPrice.of(TRADE_DATE, PRICE));
        }
        //-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            OvernightFutureTrade         test     = OvernightFutureTrade.builder().info(TRADE_INFO).product(PRODUCT).quantity(QUANTITY).price(PRICE).build();
            ResolvedOvernightFutureTrade resolved = test.resolve(REF_DATA);

            assertEquals(resolved.Info, TRADE_INFO);
            assertEquals(resolved.Product, PRODUCT.resolve(REF_DATA));
            assertEquals(resolved.Quantity, QUANTITY);
            assertEquals(resolved.TradedPrice, TradedPrice.of(TRADE_DATE, PRICE));
        }
Example #5
0
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         ResolvedOvernightFutureTrade other = (ResolvedOvernightFutureTrade)obj;
         return(JodaBeanUtils.equal(info, other.info) && JodaBeanUtils.equal(product, other.product) && JodaBeanUtils.equal(quantity, other.quantity) && JodaBeanUtils.equal(tradedPrice, other.tradedPrice));
     }
     return(false);
 }
Example #6
0
        public virtual void test_serialization()
        {
            ResolvedOvernightFutureTrade test = ResolvedOvernightFutureTrade.builder().info(TRADE_INFO).product(PRODUCT).quantity(QUANTITY).tradedPrice(TradedPrice.of(TRADE_DATE, PRICE)).build();

            assertSerialization(test);
        }