コード例 #1
0
        public virtual void test_forecastValue_unknownType()
        {
            SwapPaymentEvent mockPaymentEvent      = mock(typeof(SwapPaymentEvent));
            DispatchingSwapPaymentEventPricer test = DispatchingSwapPaymentEventPricer.DEFAULT;

            assertThrowsIllegalArg(() => test.forecastValue(mockPaymentEvent, MOCK_PROV));
        }
コード例 #2
0
        public virtual void test_currencyExposure_unknownType()
        {
            SwapPaymentEvent mockPaymentEvent      = mock(typeof(SwapPaymentEvent));
            DispatchingSwapPaymentEventPricer test = DispatchingSwapPaymentEventPricer.DEFAULT;

            assertThrowsIllegalArg(() => test.currencyExposure(mockPaymentEvent, MOCK_PROV));
        }
コード例 #3
0
        //-------------------------------------------------------------------------
        public virtual void test_presentValueSensitivity_unknownType()
        {
            SwapPaymentEvent mockPaymentEvent      = mock(typeof(SwapPaymentEvent));
            DispatchingSwapPaymentEventPricer test = DispatchingSwapPaymentEventPricer.DEFAULT;

            assertThrowsIllegalArg(() => test.presentValueSensitivity(mockPaymentEvent, MOCK_PROV));
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        //-------------------------------------------------------------------------
        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);
        }
コード例 #6
0
        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);
        }