예제 #1
0
 public void FileSystemQuery_GetFoldersAndFiles_NullPath_ExpectException()
 {
     //------------Setup for test--------------------------
     FileSystemQuery.GetFoldersAndFiles("b", 'c', null);
     //------------Execute Test---------------------------
     //------------Assert Results-------------------------
 }
예제 #2
0
 public void FileSystemQuery_GetFoldersAndFiles_NullDirectory_ExpectException()
 {
     //------------Setup for test--------------------------
     FileSystemQuery.GetFoldersAndFiles(null, 'c', new DirectoryWrapper());
     //------------Execute Test---------------------------
     //------------Assert Results-------------------------
 }
예제 #3
0
        public void FileSystemQuery_GetFoldersAndFiles_ValidPathAndDir_ExpectResults()
        {
            //------------Setup for test--------------------------

            var dir = new Mock <IDirectory>();

            dir.Setup(a => a.Exists(It.IsAny <string>())).Returns(true);
            dir.Setup(a => a.GetFileSystemEntries(It.IsAny <string>())).Returns(new[] { "a", "d", "f" });
            //------------Execute Test---------------------------
            var files = FileSystemQuery.GetFoldersAndFiles("bob", 'o', dir.Object);

            //------------Assert Results-------------------------
            Assert.AreEqual(files.Count, 3);
            Assert.AreEqual(files[0], "a");
            Assert.AreEqual(files[1], "d");
            Assert.AreEqual(files[2], "f");
        }