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