Esempio n. 1
0
        public void TestGetFileSystemEntriesWithSearchWithNoResults()
        {
            var entries = Directory.GetFileSystemEntries(longPathDirectory, "giberish").ToArray();

            Assert.AreEqual(0, entries.Length);
            Assert.IsFalse(entries.Contains(longPathFilename));
        }
Esempio n. 2
0
        public void TestGetFileSystemEntriesWithSearch()
        {
            var entries = Directory.GetFileSystemEntries(longPathDirectory, "*").ToArray();

            Assert.AreEqual(1, entries.Length);
            Assert.IsTrue(entries.Contains(longPathFilename));
        }
Esempio n. 3
0
        public void TestGetRecursiveFileSystemEntriesWithSearch()
        {
            var tempLongPathFilename = longPathDirectory.Combine(Pri.LongPath.Path.GetRandomFileName());

            tempLongPathFilename.CreateDirectory();

            try {
                Assert.IsTrue(tempLongPathFilename.Exists());
                var randomFileName = Util.CreateNewEmptyFile(tempLongPathFilename);

                var entries = Directory.GetFileSystemEntries(longPathDirectory, "*", SearchOption.AllDirectories).ToArray();
                Assert.AreEqual(3, entries.Length);
                Assert.IsTrue(entries.Contains(longPathFilename));
                Assert.IsTrue(entries.Contains(randomFileName));
            }
            finally {
                const Boolean recursive = true;
                Directory.Delete(tempLongPathFilename, recursive);
            }
        }