コード例 #1
0
        //-------------------------------------------------------------------------
        public virtual void test_ofDaysInResetPeriod()
        {
            IborAveragedFixing test     = IborAveragedFixing.ofDaysInResetPeriod(GBP_LIBOR_3M_OBS, date(2014, 7, 2), date(2014, 8, 2));
            IborAveragedFixing expected = IborAveragedFixing.builder().observation(GBP_LIBOR_3M_OBS).fixedRate(null).weight(31).build();

            assertEquals(test, expected);
        }
コード例 #2
0
        public virtual void test_ofDaysInResetPeriod_fixedRate()
        {
            IborAveragedFixing test     = IborAveragedFixing.ofDaysInResetPeriod(GBP_LIBOR_3M_OBS, date(2014, 7, 2), date(2014, 9, 2), 0.06);
            IborAveragedFixing expected = IborAveragedFixing.builder().observation(GBP_LIBOR_3M_OBS).fixedRate(0.06).weight(62).build();

            assertEquals(test, expected);
            assertEquals(test.FixedRate, double?.of(0.06));
        }
コード例 #3
0
 public virtual void test_ofDaysInResetPeriod_null()
 {
     assertThrowsIllegalArg(() => IborAveragedFixing.ofDaysInResetPeriod(null, date(2014, 7, 2), date(2014, 8, 2)));
     assertThrowsIllegalArg(() => IborAveragedFixing.ofDaysInResetPeriod(GBP_LIBOR_3M_OBS, null, date(2014, 8, 2)));
     assertThrowsIllegalArg(() => IborAveragedFixing.ofDaysInResetPeriod(GBP_LIBOR_3M_OBS, date(2014, 7, 2), null));
     assertThrowsIllegalArg(() => IborAveragedFixing.ofDaysInResetPeriod(null, null, null));
     assertThrowsIllegalArg(() => IborAveragedFixing.ofDaysInResetPeriod(null, date(2014, 7, 2), date(2014, 8, 2), 0.05));
     assertThrowsIllegalArg(() => IborAveragedFixing.ofDaysInResetPeriod(GBP_LIBOR_3M_OBS, null, date(2014, 8, 2), 0.05));
     assertThrowsIllegalArg(() => IborAveragedFixing.ofDaysInResetPeriod(GBP_LIBOR_3M_OBS, date(2014, 7, 2), null, 0.05));
     assertThrowsIllegalArg(() => IborAveragedFixing.ofDaysInResetPeriod(null, null, null, null));
 }