Пример #1
0
        public virtual void test_path()
        {
            TradeReportTemplate template = parseIni("trade-report-test-path.ini");

            TradeReportColumn payLegCcyColumn = TradeReportColumn.builder().value("Measures.LegInitialNotional.pay.currency").header("Pay Leg Ccy").build();

            assertEquals(template.Columns.Count, 1);
            assertEquals(template.Columns[0], payLegCcyColumn);
        }
Пример #2
0
        public virtual void test_ignore_failures()
        {
            TradeReportTemplate template = parseIni("trade-report-test-ignore-failures.ini");

            TradeReportColumn payLegCcyColumn = TradeReportColumn.builder().value("Measures.LegInitialNotional.pay.currency").header("Pay Leg Ccy").build();

            TradeReportColumn pvColumn = TradeReportColumn.builder().value("Measures.PresentValue").header("Present Value").ignoreFailures(true).build();

            assertEquals(template.Columns.Count, 2);
            assertEquals(template.Columns[0], payLegCcyColumn);
            assertEquals(template.Columns[1], pvColumn);
        }
Пример #3
0
        public virtual void test_simple_values()
        {
            TradeReportTemplate template = parseIni("trade-report-test-simple.ini");

            TradeReportColumn productColumn = TradeReportColumn.builder().value("Product").header("Product").build();

            TradeReportColumn pvColumn = TradeReportColumn.builder().value("Measures.PresentValue").header("Present Value").build();

            assertEquals(template.Columns.Count, 2);
            assertEquals(template.Columns[0], productColumn);
            assertEquals(template.Columns[1], pvColumn);
        }
        private TradeReportColumn parseColumn(string columnName, PropertySet properties)
        {
            TradeReportColumn.Builder columnBuilder = TradeReportColumn.builder();
            columnBuilder.header(columnName);

            if (properties.contains(VALUE_PROPERTY))
            {
                columnBuilder.value(properties.value(VALUE_PROPERTY));
            }
            if (properties.contains(IGNORE_FAILURES_PROPERTY))
            {
                string ignoreFailuresValue = properties.value(IGNORE_FAILURES_PROPERTY);
                bool   ignoresFailure      = Convert.ToBoolean(ignoreFailuresValue);
                columnBuilder.ignoreFailures(ignoresFailure);
            }
            return(columnBuilder.build());
        }
Пример #5
0
 private TradeReport report <T1>(ArrayTable <T1> table)
 {
     return(TradeReport.builder().columns(TradeReportColumn.builder().header("col0").build(), TradeReportColumn.builder().header("col1").build()).data(table).valuationDate(LocalDate.now(ZoneOffset.UTC)).runInstant(Instant.now()).build());
 }