示例#1
0
        public void StopFile_Exist()
        {
            _dummies.MoveToSource("_stopn");

            string message = _action.CheckStopFile();

            Assert.AreEqual("App suspended.", message);
        }
示例#2
0
        public void ReadOnly_Set_Remove()
        {
            /* prepare a file */
            _dummies.MoveToSource("ao");
            string filePath = ConstantsPR.TestSourcePath + @"\a.txt";

            /* set RON and verify */
            FileHelpers.SetFileReadonly(new FileInfo(filePath));
            Assert.AreEqual(true, FileHelpers.IsFileReadonly(new FileInfo(filePath)));

            /* remove RON and verify */
            FileHelpers.SetFileNotReadonly(new FileInfo(filePath));
            Assert.AreEqual(false, FileHelpers.IsFileReadonly(new FileInfo(filePath)));
        }
示例#3
0
        public void PostExecute_Arguments_PassThrough()
        {
            return;

            _dummies.MoveToSource("fn");

            _action = new DeployAction(ConstantsPR.TestSourcePath, ConstantsPR.TestTargetPath, null, new List <string>()
            {
                "f.exe", "a1", "a2", "a3"
            }, false);
            _action.Act();

            /* we expect to see f.exe window with arguments a1, a2 and a3 */
            _action.ExecuteAfter();
        }
        public void TestMoveMethods()
        {
            _dummies.MoveToSource("ao", "bn");
            _dummies.MoveToTarget("an", "en");
            _dummies.TargetIs("an", "dn");

            // empty directory get filled

            // single file get overridden (with read only  flag)

            // new file stays

            // exception on the file that absent in source

            // exception on the file that is locked in destination
        }
示例#5
0
        public void Copy_Replacing_Old_File()
        {
            /* seed both source and target */
            _pwans.MoveToSource("an", "bn");
            _pwans.MoveToTarget("ao");

            _action.Act();

            /* both files has been replaced*/
            Assert.AreEqual(true, _pwans.TargetIs("an", "bn"));
            Assert.AreEqual(false, _pwans.TargetIs("ao", "bn"));
        }