GetFilesAndFoldersIncludingNetwork() public method

public GetFilesAndFoldersIncludingNetwork ( string searchPath, List queryCollection, char directorySeparatorChar ) : List
searchPath string
queryCollection List
directorySeparatorChar char
return List
Esempio n. 1
0
        public void FileSystemQuery_GetFilesAndFoldersIncludingNetwork_MultipleSlashesShareNameDoesNotExist_ExpectFalse()
        {
            //------------Setup for test--------------------------
            var dir = new Mock<IDirectory>();
            dir.Setup(a => a.Exists("\\\\bobthebuilder\\dave")).Returns(true).Verifiable();
            dir.Setup(a => a.GetFileSystemEntries("\\\\bobthebuilder\\dave")).Returns(new string[0]);
            //------------Execute Test---------------------------
            var query = new FileSystemQuery(dir.Object, new DirectoryEntryFactory(), new ShareCollectionFactory());

            var res = query.GetFilesAndFoldersIncludingNetwork("\\\\bobthebuilder\\dave",new List<string>(), '\\');
            //------------Assert Results-------------------------
            Assert.AreEqual(res.Count,1);
            Assert.AreEqual("\\\\bobthebuilder\\dave\\".ToUpper(), res[0]);
        }