Exemplo n.º 1
0
        public void ConvertString2Number_NineDigit_ReturnString()
        {
            var input        = "452645800";
            var expectOutput = "fourty five crores twenty six lakhs fourty five thousand eight hundred";
            var ActualOutput = NumberToStringConverter.ConvertString2Number(input);

            Assert.AreEqual(expectOutput.Trim().ToLower().ToString(), ActualOutput.Trim().ToLower().ToString());
            //return true;
        }
Exemplo n.º 2
0
        public void ConvertString2Number_SixDigit_ReturnString()
        {
            var input        = "245869";
            var expectOutput = "two lakhs fourty five thousand eight hundred and sixty nine";
            var ActualOutput = NumberToStringConverter.ConvertString2Number(input);

            Assert.AreEqual(expectOutput.Trim().ToLower().ToString(), ActualOutput.Trim().ToLower().ToString());
            //return true;
        }
Exemplo n.º 3
0
        public void ConvertString2Number_FourDigit_ReturnString()
        {
            var input        = "4037";
            var expectOutput = "Four Thousand and thirty seven";
            var ActualOutput = NumberToStringConverter.ConvertString2Number(input);

            Assert.AreEqual(expectOutput.Trim().ToLower().ToString(), ActualOutput.Trim().ToLower().ToString());
            //return true;
        }
Exemplo n.º 4
0
        public void ConvertString2Number_FiveDigit_ReturnString()
        {
            var input        = "45759";
            var expectOutput = "fourty five thousand seven hundred and fifty nine";
            var ActualOutput = NumberToStringConverter.ConvertString2Number(input);

            Assert.AreEqual(expectOutput.Trim().ToLower().ToString(), ActualOutput.Trim().ToLower().ToString());
            //return true;
        }
Exemplo n.º 5
0
        public void ConvertString2Number_ThreeDigit_ReturnString()
        {
            var input        = "435";
            var expectOutput = "Four Hundred and thirty five";
            var ActualOutput = NumberToStringConverter.ConvertString2Number(input);

            Assert.AreEqual(expectOutput.Trim().ToLower().ToString(), ActualOutput.Trim().ToLower().ToString());
            //return true;
        }
Exemplo n.º 6
0
        public void ConvertString2Number_TwoDigit_ReturnString()
        {
            var input        = "21";
            var expectOutput = "Twenty One";
            var ActualOutput = NumberToStringConverter.ConvertString2Number(input);

            Assert.AreEqual(expectOutput.Trim().ToLower().ToString(), ActualOutput.Trim().ToLower().ToString());
            //return true;
        }
Exemplo n.º 7
0
        public void ConvertString2Number_NonNumberDigit_ReturnString()
        {
            var input        = "v5gd4fg";
            var expectOutput = "Invalid number";
            var ActualOutput = NumberToStringConverter.ConvertString2Number(input);

            Assert.AreEqual(expectOutput.Trim().ToLower().ToString(), ActualOutput.Trim().ToLower().ToString());
            //return true;
        }
Exemplo n.º 8
0
        public void ConvertString2Number_OutBoxDigit_ReturnString()
        {
            var input        = "452645800565644";
            var expectOutput = "out of the Box";
            var ActualOutput = NumberToStringConverter.ConvertString2Number(input);

            Assert.AreEqual(expectOutput.Trim().ToLower().ToString(), ActualOutput.Trim().ToLower().ToString());
            //return true;
        }
Exemplo n.º 9
0
        public void ConvertString2Number_OneDigit_ReturnString()
        {
            var input        = "8";
            var expectOutput = "Eight";
            var ActualOutput = NumberToStringConverter.ConvertString2Number(input);

            Assert.AreEqual(expectOutput.Trim().ToLower().ToString(), ActualOutput.Trim().ToLower().ToString());
            //return true;
            //tested
        }
Exemplo n.º 10
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to Spell The Number Assessment");
            Console.WriteLine("----------------------------------------");
            Console.WriteLine("Enter the Number to Spell or Type 'exit' to Close: ");
            var Numnput = Console.ReadLine();

            //GetSpellTheNumber(Numnput);
            while (Numnput != "exit")
            {
                var speller = NumberToStringConverter.ConvertString2Number(Numnput);
                Console.WriteLine("The Number is: " + speller);
                Numnput = Console.ReadLine();
            }
        }