Esempio n. 1
0
        public void CustomToDecimalTest()
        {
            char[] num = "10".ToCharArray();

            decimal saida = rpn.CustomToDecimal(num, 0, num.Length - 1, false);

            Assert.AreEqual(saida, (decimal)10);

            saida = rpn.CustomToDecimal(num, 0, num.Length - 1, true);
            Assert.AreEqual(saida, (decimal) - 10);

            num   = "0.564345".ToCharArray();
            saida = rpn.CustomToDecimal(num, 0, num.Length - 1, false);
            Assert.AreEqual(saida, (decimal)0.564345);

            num   = "0.564345".ToCharArray();
            saida = rpn.CustomToDecimal(num, 0, num.Length - 1, true);
            Assert.AreEqual(saida, (decimal) - 0.564345);
        }