Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "name") public void test_extendedEnum(ThreeLegBasisSwapConvention convention, String name)
        public virtual void test_extendedEnum(ThreeLegBasisSwapConvention convention, string name)
        {
            ThreeLegBasisSwapConvention.of(name);     // ensures map is populated
            ImmutableMap <string, ThreeLegBasisSwapConvention> map = ThreeLegBasisSwapConvention.extendedEnum().lookupAll();

            assertEquals(map.get(name), convention);
        }
Beispiel #2
0
        private static CurveNode curveThreeLegBasisCurveNode(string conventionStr, string timeStr, string label, QuoteId quoteId, double spread, CurveNodeDate date, CurveNodeDateOrder order)
        {
            Matcher matcher = SIMPLE_YM_TIME_REGEX.matcher(timeStr.ToUpper(Locale.ENGLISH));

            if (!matcher.matches())
            {
                throw new System.ArgumentException(Messages.format("Invalid time format for Three legs basis swap: {}", timeStr));
            }
            Period periodToEnd = Period.parse("P" + matcher.group(1));
            ThreeLegBasisSwapConvention convention = ThreeLegBasisSwapConvention.of(conventionStr);
            ThreeLegBasisSwapTemplate   template   = ThreeLegBasisSwapTemplate.of(Tenor.of(periodToEnd), convention);

            return(ThreeLegBasisSwapCurveNode.builder().template(template).rateId(quoteId).additionalSpread(spread).label(label).date(date).dateOrder(order).build());
        }
Beispiel #3
0
 public virtual void test_of_lookup_null()
 {
     assertThrowsIllegalArg(() => ThreeLegBasisSwapConvention.of((string)null));
 }
Beispiel #4
0
 public virtual void test_of_lookup_notFound()
 {
     assertThrowsIllegalArg(() => ThreeLegBasisSwapConvention.of("Rubbish"));
 }
Beispiel #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "name") public void test_of_lookup(ThreeLegBasisSwapConvention convention, String name)
        public virtual void test_of_lookup(ThreeLegBasisSwapConvention convention, string name)
        {
            assertEquals(ThreeLegBasisSwapConvention.of(name), convention);
        }