コード例 #1
0
 // parse pair info
 private static ImmutableMap <CurrencyPair, int> parsePairs(IniFile ini)
 {
     ImmutableMap.Builder <CurrencyPair, int> builder = ImmutableMap.builder();
     foreach (KeyValuePair <string, PropertySet> entry in ini.asMap().entrySet())
     {
         string pairStr = entry.Key;
         if (CurrencyPair.REGEX_FORMAT.matcher(pairStr).matches())
         {
             CurrencyPair pair       = CurrencyPair.parse(pairStr);
             PropertySet  properties = entry.Value;
             int?         rateDigits = int.Parse(properties.value("rateDigits"));
             builder.put(pair, rateDigits);
         }
     }
     return(builder.build());
 }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "parseBad", expectedExceptions = IllegalArgumentException.class) public void test_parse_String_bad(String input)
        public virtual void test_parse_String_bad(string input)
        {
            CurrencyPair.parse(input);
        }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "parseGood") public void test_parse_String_good(String input, Currency super, Currency counter)
        public virtual void test_parse_String_good(string input, Currency @base, Currency counter)
        {
            assertEquals(CurrencyPair.parse(input), CurrencyPair.of(@base, counter));
        }