Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
            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" });
            }