Ejemplo n.º 1
0
        public virtual void test_currentCash_unknownType()
        {
            SwapPaymentEvent mockPaymentEvent      = mock(typeof(SwapPaymentEvent));
            DispatchingSwapPaymentEventPricer test = DispatchingSwapPaymentEventPricer.DEFAULT;

            assertThrowsIllegalArg(() => test.currentCash(mockPaymentEvent, MOCK_PROV));
        }
Ejemplo n.º 2
0
        public virtual void test_currentCash_FxResetNotionalExchange()
        {
            double expected = 0.0123d;
            SwapPaymentEventPricer <FxResetNotionalExchange> mockCalledFn = mock(typeof(SwapPaymentEventPricer));

            when(mockCalledFn.currentCash(SwapDummyData.FX_RESET_NOTIONAL_EXCHANGE_REC_USD, MOCK_PROV)).thenReturn(expected);
            DispatchingSwapPaymentEventPricer test = new DispatchingSwapPaymentEventPricer(MOCK_NOTIONAL_EXG, mockCalledFn);

            assertEquals(test.currentCash(SwapDummyData.FX_RESET_NOTIONAL_EXCHANGE_REC_USD, MOCK_PROV), expected, 0d);
        }