public void FileSystemQuery_GetFilesListing_NoSeperator_ExpectNoResults() { var dir = new Mock <IDirectory>(); dir.Setup(a => a.GetFileSystemEntries(It.IsAny <string>(), It.IsAny <string>())).Returns(new[] { "a", "b", "c" }); var files = FileSystemQuery.GetFilesListing("bob", 'c', dir.Object); Assert.AreEqual(files.Count, 0); }
public void FileSystemQuery_GetFilesListing_CorrectPath_ExpectResults() { var dir = new Mock <IDirectory>(); dir.Setup(a => a.GetFileSystemEntries(It.IsAny <string>(), It.IsAny <string>())).Returns(new[] { "a", "b", "c" }); dir.Setup(a => a.Exists(It.IsAny <string>())).Returns(true); var files = FileSystemQuery.GetFilesListing("bob", 'o', dir.Object); Assert.AreEqual(files.Count, 3); Assert.AreEqual("a", files[0]); Assert.AreEqual("b", files[1]); Assert.AreEqual("c", files[2]); }
public void FileSystemQuery_GetFilesListing_NullDir_ExpectException() { FileSystemQuery.GetFilesListing("bob", 'c', null); }