Exemple #1
0
        public virtual void test_of()
        {
            SurfaceName test = SurfaceName.of("Foo");

            assertEquals(test.Name, "Foo");
            assertEquals(test.MarketDataType, typeof(Surface));
            assertEquals(test.ToString(), "Foo");
            assertEquals(test.CompareTo(SurfaceName.of("Goo")) < 0, true);
        }
        public virtual void test_builder1()
        {
            DefaultSurfaceMetadata test = DefaultSurfaceMetadata.builder().surfaceName(SURFACE_NAME.ToString()).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.DISCOUNT_FACTOR).zValueType(ValueType.ZERO_RATE).dayCount(ACT_365F).addInfo(DESCRIPTION, "Hello").parameterMetadata(ImmutableList.of(ParameterMetadata.empty())).build();

            assertThat(test.SurfaceName).isEqualTo(SURFACE_NAME);
            assertThat(test.XValueType).isEqualTo(ValueType.YEAR_FRACTION);
            assertThat(test.YValueType).isEqualTo(ValueType.DISCOUNT_FACTOR);
            assertThat(test.ZValueType).isEqualTo(ValueType.ZERO_RATE);
            assertThat(test.getInfo(SurfaceInfoType.DAY_COUNT)).isEqualTo(ACT_365F);
            assertThat(test.findInfo(SurfaceInfoType.DAY_COUNT)).isEqualTo(ACT_365F);
            assertThat(test.getInfo(DESCRIPTION)).isEqualTo("Hello");
            assertThat(test.findInfo(DESCRIPTION)).isEqualTo(("Hello"));
            assertThat(test.findInfo(SurfaceInfoType.of("Rubbish"))).isEqualTo(null);
            assertThat(test.ParameterMetadata.Present).True;
            assertThat(test.ParameterMetadata.get()).containsExactly(ParameterMetadata.empty());
        }