コード例 #1
0
        public void ExistsTest()
        {
            var tempPath = GetTempPath(@"SsisUnitTests\", true);

            var target = new DirectoryCommand(_testSuite)
            {
                Operation = DirectoryOperation.Exists,
                Argument1 = tempPath
            };

            object actual = target.Execute();

            Assert.AreEqual(true, actual);
        }
コード例 #2
0
        public void DeleteTest()
        {
            var tempPath = GetTempPath("DeleteMe", true);

            var target = new DirectoryCommand(_testSuite)
            {
                Operation = DirectoryOperation.Delete,
                Argument1 = tempPath
            };

            object actual = target.Execute();

            Assert.AreEqual(0, actual);
        }
コード例 #3
0
        public void DoesntExistTest()
        {
            var tempPath = GetTempPath("DoesntExist");

            var target = new DirectoryCommand(_testSuite)
            {
                Operation = DirectoryOperation.Exists,
                Argument1 = tempPath
            };

            object actual = target.Execute();

            Assert.AreEqual(false, actual);
        }
コード例 #4
0
        public void MoveTest()
        {
            var fromPath = GetTempPath(@"MoveFromTest", true);
            var toPath   = GetTempPath(@"MoveToTest");

            var target = new DirectoryCommand(_testSuite)
            {
                Operation = DirectoryOperation.Move,
                Argument1 = fromPath,
                Argument2 = toPath
            };

            object actual = target.Execute();

            Assert.AreEqual(0, actual);
        }
コード例 #5
0
        public void FileCountTest()
        {
            var tempPath = GetTempPath("FileCount", true);

            CreateTempFile(tempPath, "test1.aaa");
            CreateTempFile(tempPath, "test2.aaa");
            CreateTempFile(tempPath, "test3.aaa");

            var target = new DirectoryCommand(_testSuite)
            {
                Operation = DirectoryOperation.FileCount,
                Argument1 = tempPath,
                Argument2 = "*.aaa"
            };

            object actual = target.Execute();

            Assert.AreEqual(3, actual);
        }
コード例 #6
0
        public void MoveWithoutTargetTest()
        {
            var fromPath = GetTempPath(@"MoveFromTest");

            var target = new DirectoryCommand(_testSuite)
            {
                Operation = DirectoryOperation.Move,
                Argument1 = fromPath
            };

            try
            {
                target.Execute();
                Assert.Fail("Method did not throw the expected ArgumentException.");
            }
            catch (ArgumentException)
            {
                Assert.IsTrue(true);
            }
        }