public void SetUp() { var sourceDirectory = @"{0}\source".FormatWith(BaseDir); var destinationDirectory = @"{0}\dest".FormatWith(BaseDir); if (Directory.Exists(BaseDir)) { Directory.Delete(BaseDir, true); } Directory.CreateDirectory(BaseDir); Directory.CreateDirectory(sourceDirectory); File.WriteAllLines(_path.Combine(sourceDirectory, "test.txt"), new[] { "the test" }); Directory.CreateDirectory(destinationDirectory); _sourceFilePath = _path.GetFullPath(_path.Combine(sourceDirectory, "test.txt")); _destinationFolderPath = _path.GetFullPath(destinationDirectory); }
public void CopyDirectory() { var t = new CopyDirectoryTask(_source, _dest, DestinationCleanOptions.None, new DotNetPath()); t.Execute(); var s = File.ReadAllText(_path.Combine(_dest, "test.txt")); Assert.AreEqual("the test\r\n", s); }
public override void Context() { if (Directory.Exists(baseDirectory)) { Directory.Delete(baseDirectory, true); } Directory.CreateDirectory(baseDirectory); Directory.CreateDirectory(sourceDir); File.WriteAllLines(Path.Combine(sourceDir, "test.txt"), new[] { "the test" }); }