Пример #1
0
        //-------------------------------------------------------------------------
        public virtual void test_empty()
        {
            CurrencyParameterSensitivities test = CurrencyParameterSensitivities.empty();

            assertEquals(test.size(), 0);
            assertEquals(test.Sensitivities.size(), 0);
        }
Пример #2
0
        //-------------------------------------------------------------------------
        public virtual void test_equalWithTolerance()
        {
            CurrencyParameterSensitivities sensUsdTotal     = CurrencyParameterSensitivities.of(ENTRY_USD_TOTAL);
            CurrencyParameterSensitivities sensEur          = CurrencyParameterSensitivities.of(ENTRY_EUR);
            CurrencyParameterSensitivities sens1plus2       = SENSI_1.combinedWith(ENTRY_USD2);
            CurrencyParameterSensitivities sensZeroA        = CurrencyParameterSensitivities.of(ENTRY_ZERO3);
            CurrencyParameterSensitivities sensZeroB        = CurrencyParameterSensitivities.of(ENTRY_ZERO0);
            CurrencyParameterSensitivities sens1plus2plus0a = SENSI_1.combinedWith(ENTRY_USD2).combinedWith(ENTRY_ZERO0);
            CurrencyParameterSensitivities sens1plus2plus0b = SENSI_1.combinedWith(ENTRY_USD2).combinedWith(ENTRY_ZERO3);
            CurrencyParameterSensitivities sens1plus2plus0  = SENSI_1.combinedWith(ENTRY_USD2).combinedWith(ENTRY_ZERO0).combinedWith(ENTRY_ZERO3);
            CurrencyParameterSensitivities sens2plus0       = SENSI_2.combinedWith(sensZeroA);

            assertEquals(SENSI_1.equalWithTolerance(sensZeroA, TOLERENCE_CMP), false);
            assertEquals(SENSI_1.equalWithTolerance(SENSI_1, TOLERENCE_CMP), true);
            assertEquals(SENSI_1.equalWithTolerance(SENSI_2, TOLERENCE_CMP), false);
            assertEquals(SENSI_1.equalWithTolerance(sensUsdTotal, TOLERENCE_CMP), false);
            assertEquals(SENSI_1.equalWithTolerance(sensEur, TOLERENCE_CMP), false);
            assertEquals(SENSI_1.equalWithTolerance(sens1plus2, TOLERENCE_CMP), false);
            assertEquals(SENSI_1.equalWithTolerance(sens2plus0, TOLERENCE_CMP), false);

            assertEquals(SENSI_2.equalWithTolerance(sensZeroA, TOLERENCE_CMP), false);
            assertEquals(SENSI_2.equalWithTolerance(SENSI_1, TOLERENCE_CMP), false);
            assertEquals(SENSI_2.equalWithTolerance(SENSI_2, TOLERENCE_CMP), true);
            assertEquals(SENSI_2.equalWithTolerance(sensUsdTotal, TOLERENCE_CMP), false);
            assertEquals(SENSI_2.equalWithTolerance(sensEur, TOLERENCE_CMP), false);
            assertEquals(SENSI_2.equalWithTolerance(sens1plus2, TOLERENCE_CMP), false);
            assertEquals(SENSI_2.equalWithTolerance(sens2plus0, TOLERENCE_CMP), true);

            assertEquals(sensZeroA.equalWithTolerance(sensZeroA, TOLERENCE_CMP), true);
            assertEquals(sensZeroA.equalWithTolerance(SENSI_1, TOLERENCE_CMP), false);
            assertEquals(sensZeroA.equalWithTolerance(SENSI_2, TOLERENCE_CMP), false);
            assertEquals(sensZeroA.equalWithTolerance(sensUsdTotal, TOLERENCE_CMP), false);
            assertEquals(sensZeroA.equalWithTolerance(sensEur, TOLERENCE_CMP), false);
            assertEquals(sensZeroA.equalWithTolerance(sens1plus2, TOLERENCE_CMP), false);
            assertEquals(sensZeroA.equalWithTolerance(sens2plus0, TOLERENCE_CMP), false);
            assertEquals(sensZeroA.equalWithTolerance(sensZeroB, TOLERENCE_CMP), true);

            assertEquals(sensZeroB.equalWithTolerance(sensZeroB, TOLERENCE_CMP), true);
            assertEquals(sensZeroB.equalWithTolerance(SENSI_1, TOLERENCE_CMP), false);
            assertEquals(sensZeroB.equalWithTolerance(SENSI_2, TOLERENCE_CMP), false);
            assertEquals(sensZeroB.equalWithTolerance(sensUsdTotal, TOLERENCE_CMP), false);
            assertEquals(sensZeroB.equalWithTolerance(sensEur, TOLERENCE_CMP), false);
            assertEquals(sensZeroB.equalWithTolerance(sens1plus2, TOLERENCE_CMP), false);
            assertEquals(sensZeroB.equalWithTolerance(sens2plus0, TOLERENCE_CMP), false);
            assertEquals(sensZeroB.equalWithTolerance(sensZeroA, TOLERENCE_CMP), true);

            assertEquals(sens1plus2.equalWithTolerance(sens1plus2, TOLERENCE_CMP), true);
            assertEquals(sens1plus2.equalWithTolerance(sens1plus2plus0a, TOLERENCE_CMP), true);
            assertEquals(sens1plus2.equalWithTolerance(sens1plus2plus0b, TOLERENCE_CMP), true);
            assertEquals(sens1plus2plus0a.equalWithTolerance(sens1plus2, TOLERENCE_CMP), true);
            assertEquals(sens1plus2plus0a.equalWithTolerance(sens1plus2plus0, TOLERENCE_CMP), true);
            assertEquals(sens1plus2plus0a.equalWithTolerance(sens1plus2plus0a, TOLERENCE_CMP), true);
            assertEquals(sens1plus2plus0a.equalWithTolerance(sens1plus2plus0b, TOLERENCE_CMP), true);
            assertEquals(sens1plus2plus0b.equalWithTolerance(sens1plus2, TOLERENCE_CMP), true);
            assertEquals(sens1plus2plus0b.equalWithTolerance(sens1plus2plus0, TOLERENCE_CMP), true);
            assertEquals(sens1plus2plus0b.equalWithTolerance(sens1plus2plus0a, TOLERENCE_CMP), true);
            assertEquals(sens1plus2plus0b.equalWithTolerance(sens1plus2plus0b, TOLERENCE_CMP), true);
            assertEquals(sens2plus0.equalWithTolerance(sens2plus0, TOLERENCE_CMP), true);

            assertEquals(sensZeroA.equalWithTolerance(CurrencyParameterSensitivities.empty(), TOLERENCE_CMP), true);
            assertEquals(CurrencyParameterSensitivities.empty().equalWithTolerance(sensZeroA, TOLERENCE_CMP), true);
        }
Пример #3
0
 //-------------------------------------------------------------------------
 public virtual void coverage()
 {
     coverImmutableBean(CurrencyParameterSensitivities.empty());
     coverImmutableBean(SENSI_1);
     coverBeanEquals(SENSI_1, SENSI_2);
 }
Пример #4
0
        public virtual void test_combinedWith_empty()
        {
            CurrencyParameterSensitivities test = CurrencyParameterSensitivities.empty().combinedWith(SENSI_1);

            assertEquals(test, SENSI_1);
        }