Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "lenient") public void test_lenientLookup_specialNames(String name, RollConvention convention)
        public virtual void test_lenientLookup_specialNames(string name, RollConvention convention)
        {
            assertEquals(RollConvention.extendedEnum().findLenient(name.ToLower(Locale.ENGLISH)), convention);
        }
Example #2
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(RollConvention convention, String name)
        public virtual void test_extendedEnum(RollConvention convention, string name)
        {
            ImmutableMap <string, RollConvention> map = RollConvention.extendedEnum().lookupAll();

            assertEquals(map.get(name), convention);
        }
 /// <summary>
 /// Converts an FpML roll convention string to a {@code RollConvention}.
 /// </summary>
 /// <param name="fmplRollConventionName">  the roll convention name used by FpML </param>
 /// <returns> the roll convention </returns>
 /// <exception cref="IllegalArgumentException"> if the roll convention is not known </exception>
 public RollConvention convertRollConvention(string fmplRollConventionName)
 {
     return(RollConvention.extendedEnum().externalNames(ENUM_FPML).lookup(fmplRollConventionName));
 }
Example #4
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_lenientLookup_standardNames(RollConvention convention, String name)
        public virtual void test_lenientLookup_standardNames(RollConvention convention, string name)
        {
            assertEquals(RollConvention.extendedEnum().findLenient(name.ToLower(Locale.ENGLISH)).get(), convention);
        }
 /// <summary>
 /// Parses roll convention from the input string.
 /// <para>
 /// Parsing is case insensitive.
 /// It leniently handles a variety of known variants of roll 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 RollConvention parseRollConvention(string str)
 {
     return(RollConvention.extendedEnum().findLenient(str).orElseThrow(() => new System.ArgumentException("Unknown RollConvention value, must be one of " + RollConvention.extendedEnum().lookupAllNormalized().Keys + " but was '" + str + "'")));
 }