コード例 #1
0
ファイル: Program.cs プロジェクト: MrsCD/FunWithArrays
        /// <summary>
        /// Defines the entry point of the application.
        /// </summary>
        /// <param name="args">The arguments.</param>
        /// <exception cref="Exception">Length is not correct</exception>
        static void Main(string[] args)
        {
            var funMaker    = new FunMaker();
            var evenNumbers = funMaker.GetEvenNumbers();

            if (evenNumbers.Length == 4)
            {
                Console.WriteLine("Good");
                Console.ReadLine();
            }
        }
コード例 #2
0
        /// <summary>
        /// Defines the entry point of the application.
        /// </summary>
        /// <param name="args">The arguments.</param>
        /// <exception cref="Exception">Length is not correct</exception>
        static void Main(string[] args)
        {
            var funMaker    = new FunMaker();
            var evenNumbers = funMaker.GetEvenNumbers();

            if (evenNumbers.Length == 4)
            {
                Console.WriteLine("Well done!");
                Console.ReadLine();
            }

            throw new Exception($"Length '{evenNumbers.Length}' is not correct");
        }