public void GetCpCommandTest(string from, CopyType expType, string expArgs) { var cp = new UtilCopier(); cp.SetCopyArg(copyArgs); cp.SetCopyCmd(copyCmds); cp.SetWipDir(""); var ci = new CopyItem(); ci.From = from; (CopyType type, string cmd, string args) = cp.GetCpCommand(ci); Assert.AreEqual(expType, type); Assert.AreEqual(expArgs, args); }
public void GetDestPathTest(string toFile, string toDir, CopyType type, string expValue) { string tmpPath = Path.GetTempPath(); var cp = new UtilCopier(); cp.SetCopyArg(copyArgs); cp.SetCopyCmd(copyCmds); cp.SetWipDir(tmpPath); var ci = new CopyItem(); ci.ToFile = toFile; ci.ToDir = toDir; var dstPath = cp.GetDestPath(ci, type); var expPath = String.Format(expValue, tmpPath); Assert.AreEqual(expPath, dstPath); }