示例#1
0
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                ShowUsage();
                Console.WriteLine("Press any key to continue...");
                Console.ReadLine();
                return;
            }

            try
            {
                SearchReplaceConsoleMain main = new SearchReplaceConsoleMain();
                main.Start(args);
            }
            catch (InvalidArgumentOptionException ex)
            {
                Console.WriteLine(ex.Message);
            }
            catch (BaseException ex)
            {
                Console.WriteLine(ex.Message);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
示例#2
0
        private void SetupAndAssert(string expectedContent, string commandLine, string testFileContent = "")
        {
            if (!String.IsNullOrEmpty(testFileContent))
            {
                SetupTestFile(testFileContent);
            }
            SetupExpectedFile(expectedContent);

            SearchReplaceConsoleMain main = new SearchReplaceConsoleMain();

            main.Start(commandLine);

            AssertFilesMatched();
        }