Ejemplo n.º 1
0
        public void FromNativeNumberTest(string amountString, double resultDouble)
        {
            decimal resultDecimal = Convert.ToDecimal(resultDouble);

            CurrencyProvider.Protocol.Tron.CurrencyProvider currencyProvider = GetMainNetCurrencyProvider;

            decimal nativeNumber = currencyProvider.fromNativeNumber(amountString);

            Console.WriteLine($"{amountString}:{resultDecimal}:{nativeNumber}");
            Assert.AreEqual(resultDecimal, nativeNumber);
        }
Ejemplo n.º 2
0
        public void ExceptionTest(string amountString, ParseAmountException.CodeEnum codeEnum)
        {
            CurrencyProvider.Protocol.Tron.CurrencyProvider currencyProvider = GetMainNetCurrencyProvider;

            ParseAmountException exception = Assert.ThrowsException <ParseAmountException>(() => currencyProvider.fromNativeNumber(amountString));

            Assert.AreEqual(codeEnum, exception.Code);
            Console.WriteLine($"{amountString}:{exception.Code}:{codeEnum}");
        }