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()); } }
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(); }