//-------------------------------------------------------------------------
        public virtual void coverage()
        {
            DefaultSurfaceMetadata test = DefaultSurfaceMetadata.of(SURFACE_NAME);

            coverImmutableBean(test);
            DefaultSurfaceMetadata test2 = DefaultSurfaceMetadata.builder().surfaceName(SurfaceName.of("Test")).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.DISCOUNT_FACTOR).zValueType(ValueType.ZERO_RATE).dayCount(ACT_365F).parameterMetadata(ParameterMetadata.empty()).build();

            coverBeanEquals(test, test2);
        }
        public virtual void test_withParameterMetadata_clearWhenNonEmpty()
        {
            DefaultSurfaceMetadata test = DefaultSurfaceMetadata.of(SURFACE_NAME).withParameterMetadata(ImmutableList.of(ParameterMetadata.empty())).withParameterMetadata(null);

            assertThat(test.SurfaceName).isEqualTo(SURFACE_NAME);
            assertThat(test.XValueType).isEqualTo(ValueType.UNKNOWN);
            assertThat(test.YValueType).isEqualTo(ValueType.UNKNOWN);
            assertThat(test.ZValueType).isEqualTo(ValueType.UNKNOWN);
            assertThat(test.ParameterMetadata.Present).False;
        }
        //-------------------------------------------------------------------------
        public virtual void test_withInfo()
        {
            DefaultSurfaceMetadata @base = DefaultSurfaceMetadata.of(SURFACE_NAME);

            assertThat(@base.findInfo(SurfaceInfoType.DAY_COUNT).Present).False;
            DefaultSurfaceMetadata test = @base.withInfo(SurfaceInfoType.DAY_COUNT, ACT_360);

            assertThat(@base.findInfo(SurfaceInfoType.DAY_COUNT).Present).False;
            assertThat(test.findInfo(SurfaceInfoType.DAY_COUNT).Present).True;
        }
        public virtual void test_of_SurfaceName_noMetadata()
        {
            DefaultSurfaceMetadata test = DefaultSurfaceMetadata.of(SURFACE_NAME);

            assertThat(test.SurfaceName).isEqualTo(SURFACE_NAME);
            assertThat(test.XValueType).isEqualTo(ValueType.UNKNOWN);
            assertThat(test.YValueType).isEqualTo(ValueType.UNKNOWN);
            assertThat(test.ZValueType).isEqualTo(ValueType.UNKNOWN);
            assertThat(test.Info).isEqualTo(ImmutableMap.of());
            assertThat(test.ParameterMetadata.Present).False;
        }
        //-------------------------------------------------------------------------
        public virtual void test_withParameterMetadata()
        {
            DefaultSurfaceMetadata test = DefaultSurfaceMetadata.of(SURFACE_NAME).withParameterMetadata(ImmutableList.of(ParameterMetadata.empty()));

            assertThat(test.SurfaceName).isEqualTo(SURFACE_NAME);
            assertThat(test.XValueType).isEqualTo(ValueType.UNKNOWN);
            assertThat(test.YValueType).isEqualTo(ValueType.UNKNOWN);
            assertThat(test.ZValueType).isEqualTo(ValueType.UNKNOWN);
            assertThat(test.ParameterMetadata.Present).True;
            assertThat(test.ParameterMetadata.get()).containsExactly(ParameterMetadata.empty());
        }
예제 #6
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            DeformedSurface test1 = DeformedSurface.of(METADATA, SURFACE_ORG, FUNCTION);

            coverImmutableBean(test1);
            Surface         surface1 = InterpolatedNodalSurface.of(DefaultSurfaceMetadata.of("TestSurface1"), XVALUES, YVALUES, ZVALUES, INTERPOLATOR);
            DeformedSurface test2    = DeformedSurface.of(DefaultSurfaceMetadata.of("DeformedTestSurface1"), surface1, (DoublesPair x) =>
            {
                return(ValueDerivatives.of(surface1.zValue(x), surface1.zValueParameterSensitivity(x).Sensitivity));
            });

            coverBeanEquals(test1, test2);
        }
 /// <summary>
 /// Creates a constant surface with a specific value.
 /// </summary>
 /// <param name="name">  the surface name </param>
 /// <param name="zValue">  the constant z-value </param>
 /// <returns> the surface </returns>
 public static ConstantSurface of(SurfaceName name, double zValue)
 {
     return(new ConstantSurface(DefaultSurfaceMetadata.of(name), zValue));
 }
        public virtual void test_serialization()
        {
            DefaultSurfaceMetadata test = DefaultSurfaceMetadata.of(SURFACE_NAME);

            assertSerialization(test);
        }