Пример #1
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);
        }
        //-------------------------------------------------------------------------
        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);
        }