예제 #1
0
        public virtual void test_of_list()
        {
            CalibrationMeasures test = CalibrationMeasures.of("Test", ImmutableList.of(TradeCalibrationMeasure.FRA_PAR_SPREAD, TradeCalibrationMeasure.SWAP_PAR_SPREAD));

            assertThat(test.Name).isEqualTo("Test");
            assertThat(test.TradeTypes).containsOnly(typeof(ResolvedFraTrade), typeof(ResolvedSwapTrade));
            assertThat(test.ToString()).isEqualTo("Test");
        }
예제 #2
0
        public virtual void test_measureNotKnown()
        {
            CalibrationMeasures test = CalibrationMeasures.of("Test", TradeCalibrationMeasure.FRA_PAR_SPREAD);

            assertThrowsIllegalArg(() => test.value(SwapDummyData.SWAP_TRADE, ImmutableRatesProviderSimpleData.IMM_PROV_EUR_FIX), "Trade type 'ResolvedSwapTrade' is not supported for calibration");
        }
예제 #3
0
 public virtual void test_of_duplicate()
 {
     assertThrowsIllegalArg(() => CalibrationMeasures.of("Test", TradeCalibrationMeasure.FRA_PAR_SPREAD, TradeCalibrationMeasure.FRA_PAR_SPREAD));
     assertThrowsIllegalArg(() => CalibrationMeasures.of("Test", ImmutableList.of(TradeCalibrationMeasure.FRA_PAR_SPREAD, TradeCalibrationMeasure.FRA_PAR_SPREAD)));
 }