Exemplo n.º 1
0
        //-------------------------------------------------------------------------
        public virtual void test_plus_CurrencyAmount()
        {
            CurrencyAmount ccyAmount = CurrencyAmount.of(CCY1, AMT2);
            CurrencyAmount test      = CCY_AMOUNT.plus(ccyAmount);

            assertEquals(test, CurrencyAmount.of(CCY1, AMT1 + AMT2));
        }
        public virtual void test_convertedTo_rateProvider_conversionSize2()
        {
            FxRateProvider provider = (ccy1, ccy2) =>
            {
                if (ccy1.Equals(ccy2))
                {
                    return(1d);
                }
                if (ccy1.Equals(CCY1) && ccy2.Equals(CCY2))
                {
                    return(2.5d);
                }
                throw new System.ArgumentException();
            };
            MultiCurrencyAmount test = MultiCurrencyAmount.of(CA1, CA2);

            assertEquals(test.convertedTo(CCY2, provider), CA2.plus(CurrencyAmount.of(CCY2, AMT1 * 2.5d)));
        }