public virtual void test_currencyExposure_unknownType() { SwapPaymentEvent mockPaymentEvent = mock(typeof(SwapPaymentEvent)); DispatchingSwapPaymentEventPricer test = DispatchingSwapPaymentEventPricer.DEFAULT; assertThrowsIllegalArg(() => test.currencyExposure(mockPaymentEvent, MOCK_PROV)); }
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); }