public virtual void test_getSensitivity_name() { assertEquals(SENSI_3.getSensitivity(NAME1, NAME1, USD), ENTRY_USD); assertEquals(SENSI_3.getSensitivity(NAME1, NAME2, USD), CrossGammaParameterSensitivity.of(NAME1, METADATA1, NAME2, METADATA2, USD, MATRIX_USD2)); assertEquals(SENSI_3.getSensitivity(NAME2, NAME1, USD), CrossGammaParameterSensitivity.of(NAME2, METADATA2, NAME1, METADATA1, USD, MATRIX_USD2)); assertEquals(SENSI_3.getSensitivity(NAME2, NAME2, USD), CrossGammaParameterSensitivity.of(NAME2, METADATA2, NAME2, METADATA2, USD, DoubleMatrix.of(2, 2, -500, -400, -200, -300))); }
//------------------------------------------------------------------------- public virtual void test_getSensitivity() { CrossGammaParameterSensitivities test = CrossGammaParameterSensitivities.of(ENTRY_USD); assertEquals(test.getSensitivity(NAME1, USD), ENTRY_USD); assertThrowsIllegalArg(() => test.getSensitivity(NAME1, EUR)); assertThrowsIllegalArg(() => test.getSensitivity(NAME0, USD)); assertThrowsIllegalArg(() => test.getSensitivity(NAME0, EUR)); }