Пример #1
0
        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);
        }
Пример #2
0
        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);
        }