Exemplo n.º 1
0
        public void ConvertNumber_ConvertsA10To12DigitFrom1000000000To999999999999_String()
        {
            NumberToConvert newNumberToConvert = new NumberToConvert(123234654321);

            newNumberToConvert.ConvertNumber();
            Assert.AreEqual("one hundred twenty three billion two hundred thirty four million six hundred fifty four thousand three hundred twenty one", newNumberToConvert.StringNumber);
        }
Exemplo n.º 2
0
        public void ConvertNumber_ConvertsAFourToSixDigitFrom1000To999999_String()
        {
            NumberToConvert newNumberToConvert = new NumberToConvert(654321);

            newNumberToConvert.ConvertNumber();
            Assert.AreEqual("six hundred fifty four thousand three hundred twenty one", newNumberToConvert.StringNumber);
        }
Exemplo n.º 3
0
        public void ConvertNumber_ConvertsATripleDigitFrom100To999_String()
        {
            NumberToConvert newNumberToConvert = new NumberToConvert(367);

            newNumberToConvert.ConvertNumber();
            Assert.AreEqual("three hundred sixty seven", newNumberToConvert.StringNumber);
        }
Exemplo n.º 4
0
        public void ConvertNumber_ConvertsADoubleDigitFrom20To99_String()
        {
            NumberToConvert newNumberToConvert = new NumberToConvert(20);

            newNumberToConvert.ConvertNumber();
            Assert.AreEqual("twenty", newNumberToConvert.StringNumber);
        }
Exemplo n.º 5
0
        public void ConvertNumber_ConvertsADoubleDigitFrom10to19_String()
        {
            NumberToConvert newNumberToConvert = new NumberToConvert(14);

            newNumberToConvert.ConvertNumber();
            Assert.AreEqual("fourteen", newNumberToConvert.StringNumber);
        }
Exemplo n.º 6
0
        public void ConvertNumber_ConvertsASingleDigit_One()
        {
            NumberToConvert newNumberToConvert = new NumberToConvert(1);

            newNumberToConvert.ConvertNumber();
            Assert.AreEqual("one", newNumberToConvert.StringNumber);
        }
        public ActionResult ConvertTheNumber(string numberToConvert)
        {
            long            num     = long.Parse(numberToConvert);
            NumberToConvert userNum = new NumberToConvert(num);

            userNum.ConvertNumber();
            return(RedirectToAction("/convert", userNum));
        }
Exemplo n.º 8
0
        public static void Main()
        {
            Console.WriteLine("Input number to convert");
            long            input  = long.Parse(Console.ReadLine());
            NumberToConvert numObj = new NumberToConvert(input);

            numObj.ConvertNumber();
            Console.WriteLine(numObj.StringNumber);
        }