public void ToBitsharesSymbol() { for (int i = 0; i < (int)CurrencyTypesDep.max; i++) { CurrencyTypesDep type = (CurrencyTypesDep)i; CurrenciesRow newType = m_currencies[type.ToString()]; Assert.AreEqual(CurrencyHelpersDep.ToBitsharesSymbol(type), CurrencyHelpers.ToBitsharesSymbol(newType)); } }
public void FromSymbol() { List <string> symbols = new List <string>(); for (int i = 0; i < (int)CurrencyTypesDep.max; i++) { CurrencyTypesDep type = (CurrencyTypesDep)i; symbols.Add(type.ToString()); } foreach (string s in symbols) { string old = CurrencyHelpersDep.FromSymbol(s).ToString(); string n = CurrencyHelpers.FromSymbol(s, m_currencies).ToString(); Assert.AreEqual(old, n); } }
public void GetMarketSymbolPair() { List <string> symbols = new List <string>(); for (int i = 0; i < (int)CurrencyTypesDep.max; i++) { CurrencyTypesDep type = (CurrencyTypesDep)i; symbols.Add(type.ToString()); } for (int i = 0; i < symbols.Count - 1; i++) { for (int j = i + 1; j < symbols.Count; j++) { CurrencyTypesDep @base = CurrencyHelpersDep.FromSymbol(symbols[i]); CurrencyTypesDep quote = CurrencyHelpersDep.FromSymbol(symbols[j]); string marketOld = CurrencyHelpersDep.GetMarketSymbolPair(@base, quote); string marketNew = CurrencyHelpers.GetMarketSymbolPair(m_currencies[@base.ToString()], m_currencies[quote.ToString()]); Assert.AreEqual(marketOld, marketNew); } } }
/// <summary> Converts a type to the bitshares symbol. </summary> /// /// <remarks> Paul, 05/02/2015. </remarks> /// /// <param name="type"> The type. </param> /// /// <returns> type as a string. </returns> static public string ToBitsharesSymbol(CurrencyTypesDep type) { return(type.ToString().TrimStart(kBitassetPrefix)); }
/// <summary> Converts a type to the bitshares symbol. </summary> /// /// <remarks> Paul, 05/02/2015. </remarks> /// /// <param name="type"> The type. </param> /// /// <returns> type as a string. </returns> public static string ToBitsharesSymbol(CurrencyTypesDep type) { return type.ToString().TrimStart(kBitassetPrefix); }