Esempio n. 1
0
        public void WindowsDirectoryMoveToWindowsDirectory()
        {
            ZephyrDirectory source = Global.StageTestFilesToWindows();

            Console.WriteLine($"Source : {source.FullName}");

            String path = Path.Combine(Global.WindowsWorkingPath, $"{Global.RandomDirectory}\\");

            Console.WriteLine($"Target : {path}");
            ZephyrDirectory target = Global.WindowsWorkingDirectory.CreateDirectory(path);

            target.Create();

            String sourceCount = Global.DirectoryObjectCounts(source);

            Console.WriteLine($">> Source : [{sourceCount}]");

            source.MoveTo(target);

            String targetCount = Global.DirectoryObjectCounts(target);

            Console.WriteLine($">> Target : [{targetCount}]");

            Assert.AreEqual(sourceCount, targetCount);
            Assert.That(source.IsEmpty);

            target.Delete();
            source.Delete();
        }
Esempio n. 2
0
        public void AwsS3DirectoryMoveToWindowsDirectory()
        {
            if (!Global.TestAws)
            {
                throw new Exception("Amazon S3 Tests Are Not Enabled.  Set Global.TestAws To True To Enable.");
            }

            ZephyrDirectory source = Global.StageTestFilesToAws();

            Console.WriteLine($"Source : {source.FullName}");

            String path = $"{Global.AwsS3WorkingPath}{Global.RandomDirectory}/";

            Console.WriteLine($"Target : {path}");
            ZephyrDirectory target = Global.AwsS3WorkingDirectory.CreateDirectory(path);

            target.Create();

            String sourceCount = Global.DirectoryObjectCounts(source);

            Console.WriteLine($">> Source : [{sourceCount}]");

            source.MoveTo(target);

            String targetCount = Global.DirectoryObjectCounts(target);

            Console.WriteLine($">> Target : [{targetCount}]");

            Assert.AreEqual(sourceCount, targetCount);
            Assert.That(source.IsEmpty);

            target.Delete();
            source.Delete();
        }
Esempio n. 3
0
        public void WindowsDirectoryCreateDirectoryMethod()
        {
            String path = Path.Combine(Global.WindowsWorkingPath, $"{Global.RandomDirectory}\\");

            Console.WriteLine(path);
            ZephyrDirectory dir = Global.WindowsWorkingDirectory.CreateDirectory(path);

            Assert.That(!dir.Exists);
            dir.Create();
            Assert.That(dir.Exists);
            dir.Delete();
        }
Esempio n. 4
0
        public static ZephyrDirectory StageTestFilesToAws()
        {
            String path = $"{AwsS3WorkingPath}{RandomDirectory}/";

            Console.WriteLine($"{path}");
            ZephyrDirectory dir = AwsS3WorkingDirectory.CreateDirectory(path);

            dir.Create();
            TestFilesDirectory.CopyTo(dir, verbose: false);

            return(dir);
        }
Esempio n. 5
0
        public static ZephyrDirectory StageTestFilesToWindows()
        {
            String path = Path.Combine(WindowsWorkingPath, $"{RandomDirectory}\\");

            Console.WriteLine($"{path}");
            ZephyrDirectory dir = WindowsWorkingDirectory.CreateDirectory(path);

            dir.Create();
            TestFilesDirectory.CopyTo(dir, verbose: false);

            return(dir);
        }
Esempio n. 6
0
        public void WindowsDirectoryIsEmpty()
        {
            String path = Path.Combine(Global.WindowsWorkingPath, $"{Global.RandomDirectory}\\");

            Console.WriteLine($"{path}");
            ZephyrDirectory dir = Global.WindowsWorkingDirectory.CreateDirectory(path);

            dir.Create();
            Assert.That(dir.IsEmpty);

            Global.TestFilesDirectory.CopyTo(dir, verbose: false);
            Assert.That(!dir.IsEmpty);

            dir.Delete();
        }
Esempio n. 7
0
        public void AwsS3DirectoryCreateDirectoryMethod()
        {
            if (!Global.TestAws)
            {
                throw new Exception("Amazon S3 Tests Are Not Enabled.  Set Global.TestAws To True To Enable.");
            }

            String path = $"{Global.AwsS3WorkingPath}{Global.RandomDirectory}/";

            Console.WriteLine(path);
            ZephyrDirectory dir = Global.AwsS3WorkingDirectory.CreateDirectory(path);

            Assert.IsFalse(dir.Exists);
            dir.Create();
            Assert.IsTrue(dir.Exists);
            dir.Delete();
        }
Esempio n. 8
0
        public void AwsS3FileCreateDirectoryMethod()
        {
            if (!Global.TestAws)
            {
                throw new Exception("Amazon S3 Tests Are Not Enabled.  Set Global.TestAws To True To Enable.");
            }

            String path = $"{Global.AwsS3WorkingPath}{Global.RandomFile}";

            Console.WriteLine(path);
            ZephyrFile file = new AwsS3ZephyrFile(Global.Clients.aws, path);

            ZephyrDirectory dir = Global.AwsS3WorkingDirectory.CreateDirectory(path);

            Assert.That(!dir.Exists);
            dir.Create();
            Assert.That(dir.Exists);
            dir.Delete();
            file.Delete();
        }
Esempio n. 9
0
        public void WindowsFileCreateDirectoryMethod()
        {
            if (!Global.TestWindows)
            {
                throw new Exception("Windows Tests Are Not Enabled.  Set Global.TestWindows To True To Enable.");
            }

            String path = Path.Combine(Global.WindowsWorkingPath, $"{Global.RandomFile}");

            Console.WriteLine(path);
            ZephyrFile file = new WindowsZephyrFile(path);

            ZephyrDirectory dir = Global.WindowsWorkingDirectory.CreateDirectory(path);

            Assert.That(!dir.Exists);
            dir.Create();
            Assert.That(dir.Exists);
            dir.Delete();
            file.Delete();
        }
Esempio n. 10
0
        public void AwsS3DirectoryIsEmpty()
        {
            if (!Global.TestAws)
            {
                throw new Exception("Amazon S3 Tests Are Not Enabled.  Set Global.TestAws To True To Enable.");
            }

            String path = $"{Global.AwsS3WorkingPath}{Global.RandomDirectory}/";

            Console.WriteLine($"{path}");
            ZephyrDirectory dir = Global.AwsS3WorkingDirectory.CreateDirectory(path);

            dir.Create();
            Assert.IsTrue(dir.IsEmpty);

            Global.TestFilesDirectory.CopyTo(dir, verbose: false);
            Assert.IsFalse(dir.IsEmpty);

            dir.Delete();
        }