Esempio n. 1
0
        public void Make()
        {
            var fileSet  = new FileSet(TargetDirectory, _imageProviderFactory);
            var expected = TargetDirectory.GetFiles().Select(f => new FileNode(f, fileSet, BrowserResources.Properties.Resources.Image_File, _imageProviderFactory));

            CollectionAssert.AreEquivalent(expected, fileSet);
        }
Esempio n. 2
0
        public void PopulateMatchingFiles()
        {
            const string filePattern = "*.txt";
            var          fileSet     = new FileSet(TargetDirectory, _imageProviderFactory, filePattern);

            var expected = TargetDirectory.GetFiles(filePattern).Select(f => new FileNode(f, fileSet, BrowserResources.Properties.Resources.Image_File, _imageProviderFactory));

            CollectionAssert.AreEquivalent(expected, fileSet);
        }
Esempio n. 3
0
        /// <summary>
        /// Delete every child under this directory and leave the directory itself alone.
        /// </summary>
        public void Empty()
        {
            foreach (var file in TargetDirectory.GetFiles())
            {
                file.Delete();
            }

            foreach (var directory in TargetDirectory.GetDirectories())
            {
                directory.Delete(true);
            }
        }