//-------------------------------------------------------------------------
        public virtual void test_collectIndices()
        {
            OvernightAveragedDailyRateComputation test = OvernightAveragedDailyRateComputation.of(USD_FED_FUND, date(2016, 2, 24), date(2016, 3, 24), REF_DATA);

            ImmutableSet.Builder <Index> builder = ImmutableSet.builder();
            test.collectIndices(builder);
            assertEquals(builder.build(), ImmutableSet.of(USD_FED_FUND));
        }
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            OvernightAveragedDailyRateComputation test = OvernightAveragedDailyRateComputation.of(USD_FED_FUND, date(2016, 2, 24), date(2016, 3, 24), REF_DATA);

            coverImmutableBean(test);
            OvernightAveragedDailyRateComputation test2 = OvernightAveragedDailyRateComputation.of(GBP_SONIA, date(2014, 6, 3), date(2014, 7, 3), REF_DATA);

            coverBeanEquals(test, test2);
        }
        public virtual void test_of_noRateCutoff()
        {
            OvernightAveragedDailyRateComputation test = OvernightAveragedDailyRateComputation.of(USD_FED_FUND, date(2016, 2, 24), date(2016, 3, 24), REF_DATA);

            assertEquals(test.StartDate, date(2016, 2, 24));
            assertEquals(test.EndDate, date(2016, 3, 24));
            assertEquals(test.Index, USD_FED_FUND);
            assertEquals(test.FixingCalendar, USD_FED_FUND.FixingCalendar.resolve(REF_DATA));
        }
        //-------------------------------------------------------------------------
        public virtual void test_calculate()
        {
            OvernightAveragedDailyRateComputation test = OvernightAveragedDailyRateComputation.of(USD_FED_FUND, date(2016, 2, 24), date(2016, 3, 24), REF_DATA);

            assertEquals(test.calculateEffectiveFromFixing(date(2016, 2, 24)), USD_FED_FUND.calculateEffectiveFromFixing(date(2016, 2, 24), REF_DATA));
            assertEquals(test.calculateFixingFromEffective(date(2016, 2, 24)), USD_FED_FUND.calculateFixingFromEffective(date(2016, 2, 24), REF_DATA));
            assertEquals(test.calculatePublicationFromFixing(date(2016, 2, 24)), USD_FED_FUND.calculatePublicationFromFixing(date(2016, 2, 24), REF_DATA));
            assertEquals(test.calculateMaturityFromFixing(date(2016, 2, 24)), USD_FED_FUND.calculateMaturityFromFixing(date(2016, 2, 24), REF_DATA));
            assertEquals(test.calculateMaturityFromEffective(date(2016, 2, 24)), USD_FED_FUND.calculateMaturityFromEffective(date(2016, 2, 24), REF_DATA));
        }
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         OvernightAveragedDailyRateComputation other = (OvernightAveragedDailyRateComputation)obj;
         return(JodaBeanUtils.equal(index, other.index) && JodaBeanUtils.equal(fixingCalendar, other.fixingCalendar) && JodaBeanUtils.equal(startDate, other.startDate) && JodaBeanUtils.equal(endDate, other.endDate));
     }
     return(false);
 }
        public virtual void test_serialization()
        {
            OvernightAveragedDailyRateComputation test = OvernightAveragedDailyRateComputation.of(USD_FED_FUND, date(2016, 2, 24), date(2016, 3, 24), REF_DATA);

            assertSerialization(test);
        }
        public virtual void test_observeOn()
        {
            OvernightAveragedDailyRateComputation test = OvernightAveragedDailyRateComputation.of(USD_FED_FUND, date(2016, 2, 24), date(2016, 3, 24), REF_DATA);

            assertEquals(test.observeOn(date(2016, 2, 24)), OvernightIndexObservation.of(USD_FED_FUND, date(2016, 2, 24), REF_DATA));
        }
 public virtual void test_of_badDateOrder()
 {
     assertThrowsIllegalArg(() => OvernightAveragedDailyRateComputation.of(USD_FED_FUND, date(2016, 2, 24), date(2016, 2, 24), REF_DATA));
     assertThrowsIllegalArg(() => OvernightAveragedDailyRateComputation.of(USD_FED_FUND, date(2016, 2, 25), date(2016, 2, 24), REF_DATA));
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Creates an instance from an index and accrual period dates
 /// <para>
 /// The dates represent the accrual period.
 ///
 /// </para>
 /// </summary>
 /// <param name="index">  the index </param>
 /// <param name="startDate">  the first date of the accrual period </param>
 /// <param name="endDate">  the last date of the accrual period </param>
 /// <param name="refData">  the reference data to use when resolving holiday calendars </param>
 /// <returns> the rate computation </returns>
 public static OvernightAveragedDailyRateComputation of(OvernightIndex index, LocalDate startDate, LocalDate endDate, ReferenceData refData)
 {
     return(OvernightAveragedDailyRateComputation.builder().index(index).fixingCalendar(index.FixingCalendar.resolve(refData)).startDate(startDate).endDate(endDate).build());
 }