//-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            OvernightFuture         @base    = sut();
            ResolvedOvernightFuture expected = ResolvedOvernightFuture.builder().securityId(SECURITY_ID).currency(USD).notional(NOTIONAL).accrualFactor(ACCRUAL_FACTOR).overnightRate(OvernightRateComputation.of(USD_FED_FUND, START_DATE, END_DATE, 0, OvernightAccrualMethod.AVERAGED_DAILY, REF_DATA)).lastTradeDate(LAST_TRADE_DATE).rounding(ROUNDING).build();

            assertEquals(@base.resolve(REF_DATA), expected);
        }
示例#2
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            ResolvedOvernightFuture test1 = ResolvedOvernightFuture.builder().currency(USD).accrualFactor(ACCRUAL_FACTOR_1M).lastTradeDate(LAST_TRADE_DATE).overnightRate(RATE_COMPUTATION).notional(NOTIONAL).rounding(ROUNDING).securityId(SECURITY_ID).build();

            coverImmutableBean(test1);
            ResolvedOvernightFuture test2 = ResolvedOvernightFuture.builder().currency(GBP).accrualFactor(0.25).lastTradeDate(date(2018, 9, 28)).overnightRate(OvernightRateComputation.of(GBP_SONIA, date(2018, 9, 1), date(2018, 9, 30), 0, OvernightAccrualMethod.AVERAGED_DAILY, REF_DATA)).notional(1.0e8).securityId(SecurityId.of("OG-Test", "OnFuture2")).build();

            coverBeanEquals(test1, test2);
        }
示例#3
0
        public virtual void test_builder_default()
        {
            ResolvedOvernightFuture test = ResolvedOvernightFuture.builder().accrualFactor(ACCRUAL_FACTOR_1M).lastTradeDate(LAST_TRADE_DATE).overnightRate(RATE_COMPUTATION).notional(NOTIONAL).securityId(SECURITY_ID).build();

            assertEquals(test.AccrualFactor, ACCRUAL_FACTOR_1M);
            assertEquals(test.Currency, USD);
            assertEquals(test.Index, USD_FED_FUND);
            assertEquals(test.LastTradeDate, LAST_TRADE_DATE);
            assertEquals(test.Notional, NOTIONAL);
            assertEquals(test.OvernightRate, RATE_COMPUTATION);
            assertEquals(test.Rounding, Rounding.none());
            assertEquals(test.SecurityId, SECURITY_ID);
        }
示例#4
0
        public virtual void test_serialization()
        {
            ResolvedOvernightFuture test = ResolvedOvernightFuture.builder().currency(USD).accrualFactor(ACCRUAL_FACTOR_1M).lastTradeDate(LAST_TRADE_DATE).overnightRate(RATE_COMPUTATION).notional(NOTIONAL).rounding(ROUNDING).securityId(SECURITY_ID).build();

            assertSerialization(test);
        }