Exemple #1
0
        //-------------------------------------------------------------------------
        public virtual void test_convertedTo()
        {
            double sensi = 32d;
            IborRateSensitivity @base    = IborRateSensitivity.of(GBP_LIBOR_3M_OBSERVATION, sensi);
            double              rate     = 1.5d;
            FxMatrix            matrix   = FxMatrix.of(CurrencyPair.of(GBP, USD), rate);
            IborRateSensitivity test1    = (IborRateSensitivity)@base.convertedTo(USD, matrix);
            IborRateSensitivity expected = IborRateSensitivity.of(GBP_LIBOR_3M_OBSERVATION, USD, sensi * rate);

            assertEquals(test1, expected);
            IborRateSensitivity test2 = (IborRateSensitivity)@base.convertedTo(GBP, matrix);

            assertEquals(test2, @base);
        }