Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            string jsonString = string.Empty;

            if (GetJsonString.ReadFromFile(@".\..\..\JSON.txt", out jsonString) == false)
            {
                return;
            }


            JsonModel model = JsonToModel.StringToModel(jsonString);

            try
            {
                ResultOutput.Print(model.arrayOne, "ArrayOne");
                ResultOutput.Print(model.arrayTwo, "ArrayTwo");

                var Info = new InfoStr();
                ResultOutput.Print(TestRequest.GetUniqueValues(model.arrayOne, model.arrayTwo), Info.uniqueStr);
                ResultOutput.Print(TestRequest.GetOddNumbers(model.arrayOne, model.arrayTwo), Info.oddNbrStr);
                ResultOutput.Print(TestRequest.GetEvenNbrSum(model.arrayOne, model.arrayTwo), Info.sumStr);
            }
            catch (ArgumentNullException)
            {
                Console.WriteLine("EmptyArray");
            }
            catch (OverflowException)
            {
                Console.WriteLine("Overflow!");
            }

            Console.ReadLine();
        }