コード例 #1
0
 public void GetFiles()
 {
     var fileViewer = new FileViewer(_fileSystem);
     var files = fileViewer.GetFiles(@"c:\");
     Assert.AreEqual(3, files.Length);
     Assert.IsTrue(files.Contains(@"c:\myfile.txt"));
     Assert.IsTrue(files.Contains(@"c:\picture.jpg"));
     Assert.IsTrue(files.Contains(@"c:\anotherfile.txt"));
 }
コード例 #2
0
 public void GetAllTextFiles()
 {
     var fileViewer = new FileViewer(_fileSystem);
     var files = fileViewer.GetAllTextFiles(_tree);
     var tree = new DirectoryTree(_tree);
     tree.Files.Add(@"c:\myfile.txt");
     tree.Files.Add(@"c:\anotherfile.txt");
     tree.SubDirectories[1].Files.Add(@"c:\demo\sample.txt");
     Assert.AreEqual(tree, files);
 }