public void Run() { Console.WriteLine("当前参数:"); Console.WriteLine(Settings); Replacer replacer = new Replacer(); replacer.DoReplace(); AutoCopy autoCopy = new AutoCopy(); autoCopy.DoCopy(); Console.ReadLine(); }
public void DoReplaceWithOneReplacement() { string command = "file"; string path = "one-line.txt"; string fullSymbol = string.Format(Globals.REPLACEMENT_PATTERN, command, path); List <ReplaceSymbol> replaceSymbols = new List <ReplaceSymbol>() { new ReplaceSymbol(command, path, fullSymbol) }; string basePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string before = string.Format("Before{0}{1}{0}After", Environment.NewLine, fullSymbol); string after = string.Format("Before{0}{1}{0}After", Environment.NewLine, "This contains one line"); string actual = Replacer.DoReplace(replaceSymbols, before, basePath); Assert.AreEqual(after, actual); }