Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var filename = ParseFilename(args);
            var culture  = ParseCulture(args);

            Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo(culture);

            var results      = new CheckResults();
            var redirectList = ParseExcelFile(filename);

            foreach (var redirectUrls in redirectList)
            {
                var request = new Request {
                    RequestUrl = redirectUrls.Old
                };
                var client   = new Client();
                var response = client.Get(request);
                Console.Write(".");
                var checkResult = Analyze(response, redirectUrls);
                results.Add(checkResult);
            }

            Console.WriteLine();
            Output(results);
            Console.WriteLine("Finished...");
            Console.ReadLine();
        }
Exemplo n.º 2
0
 private static void Output(CheckResults results)
 {
     foreach (var result in results.Items.Where(x => x.IsOk == false))
     {
         if (result.IsOk)
         {
             Console.Out.WriteLine(result);
         }
         else
         {
             Console.Error.WriteLine(result);
         }
     }
 }