Exemplo n.º 1
0
        public static string DirectoryObjectCounts(ZephyrDirectory dir)
        {
            List <ZephyrDirectory> dirs  = (List <ZephyrDirectory>)dir.GetDirectories();
            List <ZephyrFile>      files = (List <ZephyrFile>)dir.GetFiles();

            //TODO: Sort Directories To Ensure Counts Come Back In Same Order

            String counts = $"{dirs.Count},{files.Count}";

            foreach (ZephyrDirectory childDir in dirs)
            {
                counts = $"{counts},{DirectoryObjectCounts(childDir)}";
            }

            return(counts);
        }
Exemplo n.º 2
0
        public void WindowsDirectoryGetDirectoriesandGetFiles()
        {
            ZephyrDirectory dir = Global.StageTestFilesToWindows();

            List <ZephyrDirectory> dirs = (List <ZephyrDirectory>)(dir.GetDirectories());

            Console.WriteLine($"Found [{dirs.Count}] Sub-directories.");
            Assert.AreEqual(dirs.Count, 3);

            List <ZephyrFile> files = (List <ZephyrFile>)(dir.GetFiles());

            Console.WriteLine($"Found [{files.Count}] Files.");
            Assert.AreEqual(files.Count, 5);

            dir.Delete(verbose: false);
        }
Exemplo n.º 3
0
        public void AwsS3DirectoryGetDirectoriesandGetFiles()
        {
            if (!Global.TestAws)
            {
                throw new Exception("Amazon S3 Tests Are Not Enabled.  Set Global.TestAws To True To Enable.");
            }

            ZephyrDirectory dir = Global.StageTestFilesToAws();

            List <ZephyrDirectory> dirs = (List <ZephyrDirectory>)(dir.GetDirectories());

            Console.WriteLine($"Found [{dirs.Count}] Sub-directories.");
            Assert.AreEqual(dirs.Count, 3);

            List <ZephyrFile> files = (List <ZephyrFile>)(dir.GetFiles());

            Console.WriteLine($"Found [{files.Count}] Files.");
            Assert.AreEqual(files.Count, 5);

            dir.Delete(verbose: false);
        }