コード例 #1
0
        public virtual void test_of_withStrikeType()
        {
            GenericVolatilitySurfacePeriodParameterMetadata test = GenericVolatilitySurfacePeriodParameterMetadata.of(TIME_TO_EXPIRY, STRIKE1);

            assertEquals(test.Identifier, Pair.of(TIME_TO_EXPIRY, STRIKE1));
            assertEquals(test.Label, Pair.of(TIME_TO_EXPIRY, STRIKE1.Label).ToString());
            assertEquals(test.Strike, STRIKE1);
            assertEquals(test.Period, TIME_TO_EXPIRY);
        }
コード例 #2
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            GenericVolatilitySurfacePeriodParameterMetadata test1 = GenericVolatilitySurfacePeriodParameterMetadata.of(TIME_TO_EXPIRY, STRIKE1);

            coverImmutableBean(test1);
            GenericVolatilitySurfacePeriodParameterMetadata test2 = GenericVolatilitySurfacePeriodParameterMetadata.of(Period.ofMonths(3), MoneynessStrike.of(1.1d));

            coverBeanEquals(test1, test2);
        }
コード例 #3
0
        public virtual void test_of_withLabel()
        {
            Pair <Period, Strike> pair = Pair.of(TIME_TO_EXPIRY, STRIKE2);
            string label = "(2, 1.35)";
            GenericVolatilitySurfacePeriodParameterMetadata test = GenericVolatilitySurfacePeriodParameterMetadata.of(TIME_TO_EXPIRY, STRIKE2, label);

            assertEquals(test.Identifier, pair);
            assertEquals(test.Label, label);
            assertEquals(test.Strike, STRIKE2);
            assertEquals(test.Period, TIME_TO_EXPIRY);
        }
 //-----------------------------------------------------------------------
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         GenericVolatilitySurfacePeriodParameterMetadata other = (GenericVolatilitySurfacePeriodParameterMetadata)obj;
         return(JodaBeanUtils.equal(period, other.period) && JodaBeanUtils.equal(strike, other.strike) && JodaBeanUtils.equal(label, other.label));
     }
     return(false);
 }
コード例 #5
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());
        }
コード例 #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 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);
        }
コード例 #7
0
        public virtual void test_serialization()
        {
            GenericVolatilitySurfacePeriodParameterMetadata test = GenericVolatilitySurfacePeriodParameterMetadata.of(TIME_TO_EXPIRY, STRIKE1);

            assertSerialization(test);
        }