/// <summary>
 /// Converts an FpML business day convention string to a {@code BusinessDayConvention}.
 /// </summary>
 /// <param name="fmplBusinessDayConventionName">  the business day convention name used by FpML </param>
 /// <returns> the business day convention </returns>
 /// <exception cref="IllegalArgumentException"> if the business day convention is not known </exception>
 public BusinessDayConvention convertBusinessDayConvention(string fmplBusinessDayConventionName)
 {
     return(BusinessDayConvention.extendedEnum().externalNames(ENUM_FPML).lookup(fmplBusinessDayConventionName));
 }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "name") public void test_lenientLookup_standardNames(BusinessDayConvention convention, String name)
        public virtual void test_lenientLookup_standardNames(BusinessDayConvention convention, string name)
        {
            assertEquals(BusinessDayConvention.extendedEnum().findLenient(name.ToLower(Locale.ENGLISH)).get(), convention);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Parses business day convention from the input string.
 /// <para>
 /// Parsing is case insensitive.
 /// It leniently handles a variety of known variants of business day conventions.
 ///
 /// </para>
 /// </summary>
 /// <param name="str">  the string to parse </param>
 /// <returns> the parsed value </returns>
 /// <exception cref="IllegalArgumentException"> if the string cannot be parsed </exception>
 public static BusinessDayConvention parseBusinessDayConvention(string str)
 {
     return(BusinessDayConvention.extendedEnum().findLenient(str).orElseThrow(() => new System.ArgumentException("Unknown BusinessDayConvention value, must be one of " + BusinessDayConvention.extendedEnum().lookupAllNormalized().Keys + " but was '" + str + "'")));
 }