CreateOnDisk() public method

public CreateOnDisk ( string parentFolder ) : void
parentFolder string
return void
Ejemplo n.º 1
0
        private void T(Folder source, Folder destination)
        {
            var entrypointDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            var root = Path.Combine(entrypointDirectory, nameof(ContentSyncTests));

            if (Directory.Exists(root))
            {
                Directory.Delete(root, recursive: true);
            }

            Directory.CreateDirectory(root);

            source.CreateOnDisk(root);
            destination.CreateOnDisk(root);

            var sourcePath      = Path.Combine(root, source.Name);
            var destinationPath = Path.Combine(root, destination.Name);

            Sync.Directories(sourcePath, destinationPath, new Arguments(sourcePath, destinationPath));

            var actual = Folder.FromDisk(Path.Combine(root, destination.Name));

            var areIdentical = Folder.AreIdentical(source, actual);

            Assert.True(areIdentical);

            Directory.Delete(root, recursive: true);
        }
Ejemplo n.º 2
0
        private void T(Folder source, Folder destination)
        {
            var entrypointDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            var root = Path.Combine(entrypointDirectory, nameof(ContentSyncTests));
            if (Directory.Exists(root))
            {
                Directory.Delete(root, recursive: true);
            }

            Directory.CreateDirectory(root);

            source.CreateOnDisk(root);
            destination.CreateOnDisk(root);

            var sourcePath = Path.Combine(root, source.Name);
            var destinationPath = Path.Combine(root, destination.Name);
            Sync.Directories(sourcePath, destinationPath, new Arguments(sourcePath, destinationPath));

            var actual = Folder.FromDisk(Path.Combine(root, destination.Name));

            var areIdentical = Folder.AreIdentical(source, actual);
            Assert.True(areIdentical);

            Directory.Delete(root, recursive: true);
        }