Ejemplo n.º 1
0
        public void ThrowErrorIfInputIsZero()
        {
            var    input  = 0;
            Action action = () => NumberConverter.Conversion(input);

            Assert.Throws <ArgumentException>(action);
        }
Ejemplo n.º 2
0
        public void ThrowErrorIfInputGreaterThan100()
        {
            var    input  = 101;
            Action action = () => NumberConverter.Conversion(input);

            Assert.Throws <NumberTooHightException>(action);
        }
Ejemplo n.º 3
0
        public static void Main(string[] args)
        {
            //    var repeat = true;
            //while (repeat)
            //{
            for (int i = 1; i <= 100; i++)
            {
                string Output = NumberConverter.Conversion(i);
                Console.WriteLine(Output);
            }



            //int user = int.Parse(Console.ReadLine());


            //if (user > 100)
            //    Console.WriteLine("number cannot be greater than 100");
            //else if (user != 0)
            //{

            //}
            //else
            //{
            // Console.WriteLine("zero can't be converted");
            //}

            //}

            Console.Read();
        }
Ejemplo n.º 4
0
        private void MultipleOfConversion(int input, string expected)
        {
            var multipleOfThreeConverted = NumberConverter.Conversion(input);

            Assert.Contains(multipleOfThreeConverted, expected);
        }