Пример #1
0
        public async Task FolderNavigationTest()
        {
            var cancellation  = ThreadingUtils.CreateCToken(10000);
            var rootDirectory = await getRoot();

            var folder1 = await rootDirectory.GetDirectoryAsync(new UPath(PATH_FORMAT, "Folder 1"), cancellation);

            var folder1_1 = await rootDirectory.GetDirectoryAsync(new UPath(PATH_FORMAT, "Folder 1\\Folder 1-1"), cancellation);

            var folder1_2 = await rootDirectory.GetDirectoryAsync(new UPath(PATH_FORMAT, "Folder 1\\Folder 1-2"), cancellation);

            await validateContent(rootDirectory, "Folder 1", "File in the root folder.txt", cancellation);
            await validateContent(folder1, "Folder 1-1,Folder 1-2", "File in the folder 1.txt,Second file in the folder 1.txt", cancellation);
            await validateContent(folder1_1, null, null, cancellation);
            await validateContent(folder1_2, null, "File in the folder 1-2.txt", cancellation);
        }
Пример #2
0
        public async Task FolderDownloadTest()
        {
            var cancellation        = ThreadingUtils.CreateCToken(1000000000);
            var targetDirectoryPath = Path.Combine(Path.GetTempPath(), "Test");

            IOUtils.RecreateDirectory(targetDirectoryPath);
            var targetDirectory = new DiskDirectory(targetDirectoryPath, IOAccess.FULL);

            await(await getRoot()).DownloadToAsync(targetDirectory, cancellation);

            var folder1 = await targetDirectory.GetDirectoryAsync(new UPath(PATH_FORMAT, "Folder 1"), cancellation);

            var folder1_1 = await targetDirectory.GetDirectoryAsync(new UPath(PATH_FORMAT, "Folder 1\\Folder 1-1"), cancellation);

            var folder1_2 = await targetDirectory.GetDirectoryAsync(new UPath(PATH_FORMAT, "Folder 1\\Folder 1-2"), cancellation);

            await validateContent(targetDirectory, "Folder 1", "File in the root folder.txt", cancellation);
            await validateContent(folder1, "Folder 1-1,Folder 1-2", "File in the folder 1.txt,Second file in the folder 1.txt", cancellation);
            await validateContent(folder1_1, null, null, cancellation);
            await validateContent(folder1_2, null, "File in the folder 1-2.txt", cancellation);
        }
Пример #3
0
 public AsyncOperationInfo(RichProgress progress, int timeout)
     : this(progress, ThreadingUtils.CreateCToken(timeout))
 {
 }