Beispiel #1
0
        public virtual void test_metadata_fixed()
        {
            FixedInflationSwapCurveNode node = FixedInflationSwapCurveNode.of(TEMPLATE, QUOTE_ID, SPREAD, LABEL).withDate(CurveNodeDate.of(VAL_DATE));
            LocalDate valuationDate          = LocalDate.of(2015, 1, 22);
            DatedParameterMetadata metadata  = node.metadata(valuationDate, REF_DATA);

            assertEquals(metadata.Date, VAL_DATE);
            assertEquals(metadata.Label, node.Label);
        }
Beispiel #2
0
        public virtual void test_metadata_last_fixing()
        {
            FixedInflationSwapCurveNode node = FixedInflationSwapCurveNode.of(TEMPLATE, QUOTE_ID, SPREAD, LABEL).withDate(CurveNodeDate.LAST_FIXING);
            LocalDate valuationDate          = LocalDate.of(2015, 1, 22);
            LocalDate fixingExpected         = LocalDate.of(2024, 10, 31); // Last day of the month
            DatedParameterMetadata metadata  = node.metadata(valuationDate, REF_DATA);

            assertEquals(metadata.Date, fixingExpected);
            assertEquals(metadata.Label, node.Label);
        }
Beispiel #3
0
        public virtual void test_metadata_end()
        {
            FixedInflationSwapCurveNode node = FixedInflationSwapCurveNode.of(TEMPLATE, QUOTE_ID, SPREAD);
            LocalDate         valuationDate  = LocalDate.of(2015, 1, 22);
            ParameterMetadata metadata       = node.metadata(valuationDate, REF_DATA);

            // 2015-01-22 is Thursday, start is 2015-01-26, but 2025-01-26 is Sunday, so end is 2025-01-27
            assertEquals(((TenorDateParameterMetadata)metadata).Date, LocalDate.of(2025, 1, 27));
            assertEquals(((TenorDateParameterMetadata)metadata).Tenor, Tenor.TENOR_10Y);
        }