Ejemplo n.º 1
0
        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));
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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);
                }
            }
        }
Ejemplo n.º 4
0
 /// <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));
 }
Ejemplo n.º 5
0
 /// <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);
 }