Пример #1
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);
        }
Пример #2
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);
        }
Пример #3
0
        public void ConvertNumber_ConvertsATripleDigitFrom100To999_String()
        {
            NumberToConvert newNumberToConvert = new NumberToConvert(367);

            newNumberToConvert.ConvertNumber();
            Assert.AreEqual("three hundred sixty seven", newNumberToConvert.StringNumber);
        }
Пример #4
0
        public void ConvertNumber_ConvertsADoubleDigitFrom20To99_String()
        {
            NumberToConvert newNumberToConvert = new NumberToConvert(20);

            newNumberToConvert.ConvertNumber();
            Assert.AreEqual("twenty", newNumberToConvert.StringNumber);
        }
Пример #5
0
        public void ConvertNumber_ConvertsADoubleDigitFrom10to19_String()
        {
            NumberToConvert newNumberToConvert = new NumberToConvert(14);

            newNumberToConvert.ConvertNumber();
            Assert.AreEqual("fourteen", newNumberToConvert.StringNumber);
        }
Пример #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));
        }
Пример #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);
        }
Пример #9
0
        public void NumberToConvertConstructor_CreatesInstanceOfNumberToConvert_NumberToConvert()
        {
            NumberToConvert newNumberToConvert = new NumberToConvert(1);

            Assert.AreEqual(typeof(NumberToConvert), newNumberToConvert.GetType());
        }