Exemplo n.º 1
0
        public void FromString_ConvertToCurrency(string convertableString, bool valueExists)
        {
            bool     parsedSuccessfully;
            Currency currency = ConvertionHelper.FromString <Currency>(convertableString, out parsedSuccessfully);

            if (!valueExists)
            {
                Assert.IsFalse(parsedSuccessfully);
                Assert.AreEqual(Currency.unknown, currency);
            }
            else
            {
                Assert.IsTrue(parsedSuccessfully);
            }
        }
Exemplo n.º 2
0
        public void FromString_ConvertToTradeInfoType(string convertableString, bool valueExists)
        {
            bool          parsedSuccessfully;
            TradeInfoType currency = ConvertionHelper.FromString <TradeInfoType>(convertableString, out parsedSuccessfully);

            if (!valueExists)
            {
                Assert.IsFalse(parsedSuccessfully);
                Assert.AreEqual(TradeInfoType.unknown, currency);
            }
            else
            {
                Assert.IsTrue(parsedSuccessfully);
            }
        }