public virtual void test_forecastValue_FxResetNotionalExchange() { double expected = 0.0123d; SwapPaymentEventPricer <FxResetNotionalExchange> mockCalledFn = mock(typeof(SwapPaymentEventPricer)); when(mockCalledFn.forecastValue(SwapDummyData.FX_RESET_NOTIONAL_EXCHANGE_REC_USD, MOCK_PROV)).thenReturn(expected); DispatchingSwapPaymentEventPricer test = new DispatchingSwapPaymentEventPricer(MOCK_NOTIONAL_EXG, mockCalledFn); assertEquals(test.forecastValue(SwapDummyData.FX_RESET_NOTIONAL_EXCHANGE_REC_USD, MOCK_PROV), expected, 0d); }
public virtual void test_currencyExposure_FxResetNotionalExchange() { MultiCurrencyAmount expected = MultiCurrencyAmount.of(Currency.GBP, 0.0123d); SwapPaymentEventPricer <FxResetNotionalExchange> mockCalledFn = mock(typeof(SwapPaymentEventPricer)); when(mockCalledFn.currencyExposure(SwapDummyData.FX_RESET_NOTIONAL_EXCHANGE_REC_USD, MOCK_PROV)).thenReturn(expected); DispatchingSwapPaymentEventPricer test = new DispatchingSwapPaymentEventPricer(MOCK_NOTIONAL_EXG, mockCalledFn); assertEquals(test.currencyExposure(SwapDummyData.FX_RESET_NOTIONAL_EXCHANGE_REC_USD, MOCK_PROV), expected); }
//------------------------------------------------------------------------- public virtual void test_presentValue_NotionalExchange() { double expected = 0.0123d; SwapPaymentEventPricer <NotionalExchange> mockCalledFn = mock(typeof(SwapPaymentEventPricer)); when(mockCalledFn.presentValue(SwapDummyData.NOTIONAL_EXCHANGE_REC_GBP, MOCK_PROV)).thenReturn(expected); DispatchingSwapPaymentEventPricer test = new DispatchingSwapPaymentEventPricer(mockCalledFn, MOCK_FX_NOTIONAL_EXG); assertEquals(test.presentValue(SwapDummyData.NOTIONAL_EXCHANGE_REC_GBP, MOCK_PROV), expected, 0d); }
/// <summary> /// Creates an instance. /// </summary> /// <param name="notionalExchangePricer"> the pricer for <seealso cref="NotionalExchange"/> </param> /// <param name="fxResetNotionalExchangePricer"> the pricer for <seealso cref="FxResetNotionalExchange"/> </param> public DispatchingSwapPaymentEventPricer(SwapPaymentEventPricer <NotionalExchange> notionalExchangePricer, SwapPaymentEventPricer <FxResetNotionalExchange> fxResetNotionalExchangePricer) { this.notionalExchangePricer = ArgChecker.notNull(notionalExchangePricer, "notionalExchangePricer"); this.fxResetNotionalExchangePricer = ArgChecker.notNull(fxResetNotionalExchangePricer, "fxResetNotionalExchangePricer"); }