SearchForFileAndFolders() public method

public SearchForFileAndFolders ( string searchPath, List queryCollection, char directorySeparatorChar ) : List
searchPath string
queryCollection List
directorySeparatorChar char
return List
Example #1
0
        public void FileSystemQuery_SearchForFileAndFolders_DriveSearchPath_ExpectCurrentValues()
        {
            //------------Setup for test--------------------------
             var dir = new Mock<IDirectory>();
             dir.Setup(a => a.GetFileSystemEntries(It.IsAny<string>())).Returns(new[] { "a", "b", "c" });
             dir.Setup(a => a.Exists(It.IsAny<string>())).Returns(true);
             var query = new FileSystemQuery(dir.Object, new DirectoryEntryFactory(), new ShareCollectionFactory());
             var files = new List<string> { "non" };

             files = query.SearchForFileAndFolders(@"c:", files, '\\');
             //------------Assert Results-------------------------

             Assert.AreEqual(files.Count, 3);
             Assert.AreEqual("a", files[0]);
             Assert.AreEqual("b", files[1]);
             Assert.AreEqual("c", files[2]);
        }