public void WindowsDirectoryProperties() { String dirName = Global.RandomDirectory; String path = Path.Combine(Global.WindowsWorkingPath, $"{dirName}\\"); Console.WriteLine(path); ZephyrDirectory dir = new WindowsZephyrDirectory(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.WindowsWorkingPath); Console.WriteLine($"Root : {dir.Root}"); Assert.AreEqual(dir.Root, Directory.GetDirectoryRoot(Global.WindowsWorkingPath)); Console.WriteLine($"Exists : {dir.Exists}"); Assert.That(dir.Exists); dir.Delete(); }
public void WindowsFileMoveToWindowsDirectory() { if (!Global.TestWindows) { throw new Exception("Windows Tests Are Not Enabled. Set Global.TestWindows To True To Enable."); } ZephyrDirectory source = Global.StageTestFilesToWindows(); string path = Path.Combine(Global.WindowsWorkingPath, $"{Global.RandomDirectory}\\"); ZephyrDirectory target = new WindowsZephyrDirectory(path); List <ZephyrFile> files = (List <ZephyrFile>)source.GetFiles(); Assert.IsNotEmpty(files); foreach (ZephyrFile file in files) { String filePath = Path.Combine(target.FullName, file.Name); file.MoveTo(target); Assert.That(File.Exists(filePath)); Assert.That(!file.Exists); Utilities.Delete(filePath, Global.Clients); } source.Delete(); }
public void WindowsDirectoryDelete() { String path = Path.Combine(Global.WindowsWorkingPath, $"{Global.RandomDirectory}\\"); Console.WriteLine(path); ZephyrDirectory dir = new WindowsZephyrDirectory(path); dir.Create(); dir.Delete(); Assert.That(!Utilities.Exists(path, Global.Clients)); }
public void Init() { if (TestWindows) { WindowsWorkingPath = Path.Combine(WindowsWorkspace, $"temp_{Global.RandomDirectory}\\"); WindowsWorkingDirectory = Utilities.CreateDirectory(WindowsWorkingPath, Clients); } if (TestAws) { Clients.aws = Utilities.InitAwsClient(AwsS3Region, AwsS3AccessKey, AwsS3SecretKey); AwsS3WorkingPath = $"{AwsS3Workspace}{Global.RandomDirectory}/"; AwsS3WorkingDirectory = Utilities.CreateDirectory(AwsS3WorkingPath, Clients); } // Get Path To The Project's "TestFiles" Folder String assemblyDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase); UriBuilder uri = new UriBuilder(assemblyDir); string path = Uri.UnescapeDataString(uri.Path); DirectoryInfo dInfo = new DirectoryInfo(Path.GetDirectoryName(path)); TestFilesPath = $"{dInfo.Parent.FullName}\\TestFiles\\"; TestFilesDirectory = new WindowsZephyrDirectory(Global.TestFilesPath); }