示例#1
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            SwaptionSurfaceExpirySimpleMoneynessParameterMetadata test1 = SwaptionSurfaceExpirySimpleMoneynessParameterMetadata.of(TIME_TO_EXPIRY, SIMPLE_MONEYNESS);

            coverImmutableBean(test1);
            SwaptionSurfaceExpirySimpleMoneynessParameterMetadata test2 = SwaptionSurfaceExpirySimpleMoneynessParameterMetadata.of(2.5d, 60d, "(2.5, 60)");

            coverBeanEquals(test1, test2);
        }
示例#2
0
        public virtual void test_of_noLabel()
        {
            SwaptionSurfaceExpirySimpleMoneynessParameterMetadata test = SwaptionSurfaceExpirySimpleMoneynessParameterMetadata.of(TIME_TO_EXPIRY, SIMPLE_MONEYNESS);

            assertEquals(test.Identifier, Pair.of(TIME_TO_EXPIRY, SIMPLE_MONEYNESS));
            assertEquals(test.Label, Pair.of(TIME_TO_EXPIRY, SIMPLE_MONEYNESS).ToString());
            assertEquals(test.SimpleMoneyness, SIMPLE_MONEYNESS);
            assertEquals(test.YearFraction, TIME_TO_EXPIRY);
        }
示例#3
0
        public virtual void test_of_withLabel()
        {
            string label = "(1.5Y, 0.25)";
            SwaptionSurfaceExpirySimpleMoneynessParameterMetadata test = SwaptionSurfaceExpirySimpleMoneynessParameterMetadata.of(TIME_TO_EXPIRY, SIMPLE_MONEYNESS, label);

            assertEquals(test.Identifier, Pair.of(TIME_TO_EXPIRY, SIMPLE_MONEYNESS));
            assertEquals(test.Label, label);
            assertEquals(test.SimpleMoneyness, SIMPLE_MONEYNESS);
            assertEquals(test.YearFraction, TIME_TO_EXPIRY);
        }
示例#4
0
        static NormalSwaptionExpirySimpleMoneynessVolatilitiesTest()
        {
            IList <SwaptionSurfaceExpirySimpleMoneynessParameterMetadata> list = new List <SwaptionSurfaceExpirySimpleMoneynessParameterMetadata>();
            int nData = TIME.size();

            for (int i = 0; i < nData; ++i)
            {
                SwaptionSurfaceExpirySimpleMoneynessParameterMetadata parameterMetadata = SwaptionSurfaceExpirySimpleMoneynessParameterMetadata.of(TIME.get(i), SIMPLE_MONEYNESS.get(i));
                list.Add(parameterMetadata);
            }
            METADATA = Surfaces.normalVolatilityByExpirySimpleMoneyness("GOVT1-SWAPTION-VOL", ACT_365F, MoneynessType.RATES).withParameterMetadata(list);
        }
示例#5
0
        public virtual void test_serialization()
        {
            SwaptionSurfaceExpirySimpleMoneynessParameterMetadata test = SwaptionSurfaceExpirySimpleMoneynessParameterMetadata.of(TIME_TO_EXPIRY, SIMPLE_MONEYNESS);

            assertSerialization(test);
        }