Ejemplo n.º 1
0
        //-------------------------------------------------------------------------
        public virtual void test_forecastValue_RatePaymentPeriod()
        {
            double expected = 0.0123d;
            SwapPaymentPeriodPricer <RatePaymentPeriod> mockNotionalExchangeFn = mock(typeof(SwapPaymentPeriodPricer));

            when(mockNotionalExchangeFn.forecastValue(SwapDummyData.FIXED_RATE_PAYMENT_PERIOD_REC_GBP, MOCK_PROV)).thenReturn(expected);
            DispatchingSwapPaymentPeriodPricer test = new DispatchingSwapPaymentPeriodPricer(mockNotionalExchangeFn, MOCK_KNOWN);

            assertEquals(test.forecastValue(SwapDummyData.FIXED_RATE_PAYMENT_PERIOD_REC_GBP, MOCK_PROV), expected, 0d);
        }
Ejemplo n.º 2
0
        //-------------------------------------------------------------------------
        public virtual void test_currencyExposure_RatePaymentPeriod()
        {
            MultiCurrencyAmount expected = MultiCurrencyAmount.of(GBP, 0.0123d);
            SwapPaymentPeriodPricer <RatePaymentPeriod> mockNotionalExchangeFn = mock(typeof(SwapPaymentPeriodPricer));

            when(mockNotionalExchangeFn.currencyExposure(SwapDummyData.FIXED_RATE_PAYMENT_PERIOD_REC_GBP, MOCK_PROV)).thenReturn(expected);
            DispatchingSwapPaymentPeriodPricer test = new DispatchingSwapPaymentPeriodPricer(mockNotionalExchangeFn, MOCK_KNOWN);

            assertEquals(test.currencyExposure(SwapDummyData.FIXED_RATE_PAYMENT_PERIOD_REC_GBP, MOCK_PROV), expected);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates an instance.
 /// </summary>
 /// <param name="ratePaymentPeriodPricer">  the pricer for <seealso cref="RatePaymentPeriod"/> </param>
 /// <param name="knownAmountPaymentPeriodPricer">  the pricer for <seealso cref="KnownAmountSwapPaymentPeriod"/> </param>
 public DispatchingSwapPaymentPeriodPricer(SwapPaymentPeriodPricer <RatePaymentPeriod> ratePaymentPeriodPricer, SwapPaymentPeriodPricer <KnownAmountSwapPaymentPeriod> knownAmountPaymentPeriodPricer)
 {
     this.ratePaymentPeriodPricer        = ArgChecker.notNull(ratePaymentPeriodPricer, "ratePaymentPeriodPricer");
     this.knownAmountPaymentPeriodPricer = ArgChecker.notNull(knownAmountPaymentPeriodPricer, "knownAmountPaymentPeriodPricer");
 }