Пример #1
0
        public virtual void test_builder1()
        {
            RatesCurveGroupDefinition test = RatesCurveGroupDefinition.builder().name(CurveGroupName.of("Test")).addDiscountCurve(CURVE_DEFN1, GBP).addForwardCurve(CURVE_DEFN1, GBP_SONIA).addForwardCurve(CURVE_DEFN1, GBP_LIBOR_1W).addForwardCurve(CURVE_DEFN2, GBP_LIBOR_1M, GBP_LIBOR_3M).build();

            assertEquals(test.Name, CurveGroupName.of("Test"));
            assertEquals(test.Entries, ImmutableList.of(ENTRY1, ENTRY2));
            assertEquals(test.findDiscountCurveName(GBP), CURVE_NAME1);
            assertEquals(test.findDiscountCurveName(USD), null);
            assertEquals(test.findForwardCurveName(GBP_LIBOR_1W), CURVE_NAME1);
            assertEquals(test.findForwardCurveName(GBP_LIBOR_1M), CURVE_NAME2);
            assertEquals(test.findForwardCurveName(GBP_LIBOR_6M), null);
            assertEquals(test.findForwardCurveNames(GBP_LIBOR), ImmutableSet.of(CURVE_NAME1, CURVE_NAME2));
            assertEquals(test.findEntry(CurveName.of("Test")), ENTRY1);
            assertEquals(test.findEntry(CurveName.of("Test2")), ENTRY2);
            assertEquals(test.findEntry(CurveName.of("Rubbish")), null);
            assertEquals(test.findCurveDefinition(CurveName.of("Test")), CURVE_DEFN1);
            assertEquals(test.findCurveDefinition(CurveName.of("Test2")), CURVE_DEFN2);
            assertEquals(test.findCurveDefinition(CurveName.of("Rubbish")), null);
        }