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); }
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); }
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); }
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); }
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); }
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); } }