Exemplo n.º 1
0
        public virtual void test_builder_incomplete()
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.joda.beans.BeanBuilder<? extends TenorParameterMetadata> builder = TenorParameterMetadata.meta().builder();
            BeanBuilder <TenorParameterMetadata> builder = TenorParameterMetadata.meta().builder();

            assertThrowsIllegalArg(() => builder.build());
        }
Exemplo n.º 2
0
        public virtual void test_builder_defaultLabel()
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.joda.beans.BeanBuilder<? extends TenorParameterMetadata> builder = TenorParameterMetadata.meta().builder();
            BeanBuilder <TenorParameterMetadata> builder = TenorParameterMetadata.meta().builder();

            builder.set(TenorParameterMetadata.meta().tenor(), TENOR_10Y);
            TenorParameterMetadata test = builder.build();

            assertEquals(test.Tenor, TENOR_10Y);
            assertEquals(test.Label, "10Y");
            assertEquals(test.Identifier, TENOR_10Y);
        }
Exemplo n.º 3
0
        public virtual void test_builder_incomplete()
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.joda.beans.BeanBuilder<? extends GenericVolatilitySurfacePeriodParameterMetadata> builder1 = GenericVolatilitySurfacePeriodParameterMetadata.meta().builder();
            BeanBuilder <GenericVolatilitySurfacePeriodParameterMetadata> builder1 = GenericVolatilitySurfacePeriodParameterMetadata.meta().builder();

            assertThrowsIllegalArg(() => builder1.build());
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.joda.beans.BeanBuilder<? extends GenericVolatilitySurfacePeriodParameterMetadata> builder2 = GenericVolatilitySurfacePeriodParameterMetadata.meta().builder();
            BeanBuilder <GenericVolatilitySurfacePeriodParameterMetadata> builder2 = GenericVolatilitySurfacePeriodParameterMetadata.meta().builder();

            builder2.set(GenericVolatilitySurfacePeriodParameterMetadata.meta().period(), TIME_TO_EXPIRY);
            assertThrowsIllegalArg(() => builder2.build());
        }
Exemplo n.º 4
0
        public virtual void test_builder_defaultLabel()
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.joda.beans.BeanBuilder<? extends YearMonthDateParameterMetadata> builder = YearMonthDateParameterMetadata.meta().builder();
            BeanBuilder <YearMonthDateParameterMetadata> builder = YearMonthDateParameterMetadata.meta().builder();

            builder.set(YearMonthDateParameterMetadata.meta().date(), DATE);
            builder.set(YearMonthDateParameterMetadata.meta().yearMonth(), JAN2015);
            YearMonthDateParameterMetadata test = builder.build();

            assertEquals(test.Date, DATE);
            assertEquals(test.YearMonth, JAN2015);
            assertEquals(test.Label, "Jan15");
            assertEquals(test.Identifier, JAN2015);
        }
Exemplo n.º 5
0
        public virtual void test_builder_noLabel()
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.joda.beans.BeanBuilder<? extends GenericVolatilitySurfacePeriodParameterMetadata> builder = GenericVolatilitySurfacePeriodParameterMetadata.meta().builder();
            BeanBuilder <GenericVolatilitySurfacePeriodParameterMetadata> builder = GenericVolatilitySurfacePeriodParameterMetadata.meta().builder();
            Pair <Period, Strike> pair = Pair.of(TIME_TO_EXPIRY, STRIKE1);

            builder.set(GenericVolatilitySurfacePeriodParameterMetadata.meta().period(), TIME_TO_EXPIRY);
            builder.set(GenericVolatilitySurfacePeriodParameterMetadata.meta().strike(), STRIKE1);
            GenericVolatilitySurfacePeriodParameterMetadata test = builder.build();

            assertEquals(test.Identifier, pair);
            assertEquals(test.Label, Pair.of(TIME_TO_EXPIRY, STRIKE1.Label).ToString());
            assertEquals(test.Strike, STRIKE1);
            assertEquals(test.Period, TIME_TO_EXPIRY);
        }
Exemplo n.º 6
0
        public virtual void test_builder_noLabel()
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.joda.beans.BeanBuilder<? extends SwaptionSurfaceExpiryStrikeParameterMetadata> builder = SwaptionSurfaceExpiryStrikeParameterMetadata.meta().builder();
            BeanBuilder <SwaptionSurfaceExpiryStrikeParameterMetadata> builder = SwaptionSurfaceExpiryStrikeParameterMetadata.meta().builder();
            Pair <double, double> pair = Pair.of(TIME_TO_EXPIRY, STRIKE);

            builder.set(SwaptionSurfaceExpiryStrikeParameterMetadata.meta().yearFraction(), TIME_TO_EXPIRY);
            builder.set(SwaptionSurfaceExpiryStrikeParameterMetadata.meta().strike(), STRIKE);
            SwaptionSurfaceExpiryStrikeParameterMetadata test = builder.build();

            assertEquals(test.Identifier, pair);
            assertEquals(test.Label, pair.ToString());
            assertEquals(test.Strike, STRIKE);
            assertEquals(test.YearFraction, TIME_TO_EXPIRY);
        }
Exemplo n.º 7
0
        public virtual void test_builder_noLabel()
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.joda.beans.BeanBuilder<? extends FxVolatilitySurfaceYearFractionParameterMetadata> builder = FxVolatilitySurfaceYearFractionParameterMetadata.meta().builder();
            BeanBuilder <FxVolatilitySurfaceYearFractionParameterMetadata> builder = FxVolatilitySurfaceYearFractionParameterMetadata.meta().builder();
            Pair <double, Strike> pair = Pair.of(TIME_TO_EXPIRY, STRIKE);

            builder.set(FxVolatilitySurfaceYearFractionParameterMetadata.meta().currencyPair(), CURRENCY_PAIR);
            builder.set(FxVolatilitySurfaceYearFractionParameterMetadata.meta().yearFraction(), TIME_TO_EXPIRY);
            builder.set(FxVolatilitySurfaceYearFractionParameterMetadata.meta().strike(), STRIKE);
            FxVolatilitySurfaceYearFractionParameterMetadata test = builder.build();

            assertEquals(test.CurrencyPair, CURRENCY_PAIR);
            assertEquals(test.Identifier, pair);
            assertEquals(test.Label, Pair.of(TIME_TO_EXPIRY, STRIKE.Label).ToString());
            assertEquals(test.Strike, STRIKE);
            assertEquals(test.YearFraction, TIME_TO_EXPIRY);
        }
Exemplo n.º 8
0
        public virtual void test_builder_withLabel()
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.joda.beans.BeanBuilder<? extends SwaptionSurfaceExpirySimpleMoneynessParameterMetadata> builder = SwaptionSurfaceExpirySimpleMoneynessParameterMetadata.meta().builder();
            BeanBuilder <SwaptionSurfaceExpirySimpleMoneynessParameterMetadata> builder = SwaptionSurfaceExpirySimpleMoneynessParameterMetadata.meta().builder();
            Pair <double, double> pair = Pair.of(TIME_TO_EXPIRY, SIMPLE_MONEYNESS);
            string label = "(1.5Y, 0.25)";

            builder.set(SwaptionSurfaceExpirySimpleMoneynessParameterMetadata.meta().yearFraction(), TIME_TO_EXPIRY);
            builder.set(SwaptionSurfaceExpirySimpleMoneynessParameterMetadata.meta().simpleMoneyness(), SIMPLE_MONEYNESS);
            builder.set(SwaptionSurfaceExpirySimpleMoneynessParameterMetadata.meta().label(), label);
            SwaptionSurfaceExpirySimpleMoneynessParameterMetadata test = builder.build();

            assertEquals(test.Identifier, pair);
            assertEquals(test.Label, label);
            assertEquals(test.SimpleMoneyness, SIMPLE_MONEYNESS);
            assertEquals(test.YearFraction, TIME_TO_EXPIRY);
        }
        public virtual void test_builder_withLabel()
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.joda.beans.BeanBuilder<? extends GenericVolatilitySurfaceYearFractionParameterMetadata> builder = GenericVolatilitySurfaceYearFractionParameterMetadata.meta().builder();
            BeanBuilder <GenericVolatilitySurfaceYearFractionParameterMetadata> builder = GenericVolatilitySurfaceYearFractionParameterMetadata.meta().builder();
            Pair <double, Strike> pair = Pair.of(TIME_TO_EXPIRY, STRIKE1);
            string label = "(1.5, 0.75)";

            builder.set(GenericVolatilitySurfaceYearFractionParameterMetadata.meta().yearFraction(), TIME_TO_EXPIRY);
            builder.set(GenericVolatilitySurfaceYearFractionParameterMetadata.meta().strike(), STRIKE1);
            builder.set(GenericVolatilitySurfaceYearFractionParameterMetadata.meta().label(), label);
            GenericVolatilitySurfaceYearFractionParameterMetadata test = builder.build();

            assertEquals(test.Identifier, pair);
            assertEquals(test.Label, label);
            assertEquals(test.Strike, STRIKE1);
            assertEquals(test.YearFraction, TIME_TO_EXPIRY);
        }