示例#1
0
    public static void Main()
    {
        Console.WriteLine("Please enter a number:");
        int input = int.Parse(Console.ReadLine());

        if (input < 20)
        {
            NumberConvert newNumber = new NumberConvert(input);
            newNumber.OnesName();
            foreach (string item in NumberConvert.masterList)
            {
                Console.WriteLine(item);
            }
        }
        else if (input > 19 && input < 100)
        {
            NumberConvert newNumber = new NumberConvert(input);
            newNumber.TensName();
            foreach (string item in NumberConvert.masterList)
            {
                Console.WriteLine(item);
            }
        }
        else if (input > 99 && input < 1000)
        {
            NumberConvert newNumber = new NumberConvert(input);
            newNumber.HundredsName();
            foreach (string item in NumberConvert.masterList)
            {
                Console.WriteLine(item);
            }
        }
    }
示例#2
0
        public void TensName_RecieveLetterNameOfNumber_String()
        {
            NumberConvert newNumber = new NumberConvert(23);
            string        result    = newNumber.TensName();

            Assert.AreEqual("twenty three", result);
        }