public void FileCount_FolderWithOneFile() { IFileBase fileInfo = Utils.MockFolder("root", "root"); IFileBase childFileInfo = Utils.MockFile("file", "file", "text/plain"); IFileNode fileNode = new FileNode(fileInfo, new List<IFileNode> { new FileNode(childFileInfo) }); Assert.AreEqual(1, fileNode.FileCount()); }
public void FileCount_TwoFoldersThreeFiles() { IFileBase rootFolder = Utils.MockFolder("root", "root"); IFileBase childFolder = Utils.MockFolder("folder", "folder"); IFileBase rootFile = Utils.MockFile("file", "file", "text/plain"); IFileBase childFile1 = Utils.MockFile("file1", "file1", "text/plain"); IFileBase childFile2 = Utils.MockFile("file2", "file2", "text/plain"); IFileNode fileNode = new FileNode(rootFolder, new List<IFileNode> { new FileNode(rootFile), new FileNode(childFolder, new List<IFileNode> { new FileNode(childFile1), new FileNode(childFile2) }) }); Assert.AreEqual(3, fileNode.FileCount()); }
public void FileCount_SingleFile() { IFileBase childFileInfo = Utils.MockFile("file", "file", "text/plain"); IFileNode fileNode = new FileNode(childFileInfo); Assert.AreEqual(1, fileNode.FileCount()); }
public void FileCount_EmptyFolder() { IFileBase fileInfo = Utils.MockFolder("root", "root"); IFileNode fileNode = new FileNode(fileInfo); Assert.AreEqual(0, fileNode.FileCount()); }