コード例 #1
0
        //-------------------------------------------------------------------------
        public virtual void test_convertedTo()
        {
            double sensi = 32d;
            InflationRateSensitivity @base = InflationRateSensitivity.of(GB_HICP_OBS, sensi);
            double   rate   = 1.5d;
            FxMatrix matrix = FxMatrix.of(CurrencyPair.of(GBP, USD), rate);
            InflationRateSensitivity test1    = (InflationRateSensitivity)@base.convertedTo(USD, matrix);
            InflationRateSensitivity expected = InflationRateSensitivity.of(GB_HICP_OBS, USD, sensi * rate);

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

            assertEquals(test2, @base);
        }