Exemplo n.º 1
0
        public void AwsS3FileMoveToAwsS3Directory()
        {
            if (!Global.TestAws)
            {
                throw new Exception("Amazon S3 Tests Are Not Enabled.  Set Global.TestAws To True To Enable.");
            }

            ZephyrDirectory source = Global.StageTestFilesToAws();
            string          path   = $"{Global.AwsS3WorkingPath}{Global.RandomDirectory}/";
            ZephyrDirectory target = new AwsS3ZephyrDirectory(Global.Clients.aws, path);

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

            Assert.IsNotEmpty(files);
            foreach (ZephyrFile file in files)
            {
                String filePath = $"{target.FullName}{file.Name}";
                file.MoveTo(target);
                Assert.That(Utilities.Exists(filePath, Global.Clients));
                Assert.That(!file.Exists);
                Utilities.Delete(filePath, Global.Clients);
            }

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

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

            Console.WriteLine(path);
            ZephyrDirectory dir = new AwsS3ZephyrDirectory(Global.Clients.aws, path);

            dir.Create();

            Console.WriteLine($"FullName : {dir.FullName}");
            Assert.AreEqual(dir.FullName, path);

            Console.WriteLine($"Name     : {dir.Name}");
            Assert.AreEqual(dir.Name, dirName);

            Console.WriteLine($"Parent   : {dir.Parent}");
            Assert.AreEqual(dir.Parent, Global.AwsS3WorkingPath);

            Console.WriteLine($"Root     : {dir.Root}");
            Assert.AreEqual(dir.Root, Global.AwsS3WorkingDirectory.Root);

            Console.WriteLine($"Exists   : {dir.Exists}");
            Assert.That(dir.Exists);

            dir.Delete();
        }
Exemplo n.º 3
0
        public void AwsS3DirectoryCreate()
        {
            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 = new AwsS3ZephyrDirectory(Global.Clients.aws, path);

            dir.Create();
            Assert.IsTrue(Utilities.Exists(path, Global.Clients));
            dir.Delete();
        }