public static void ClientRetrivesFileListContentsCorrectly() { var credentials = CredentialsProvider.Instance.GetCredentials(); var httpClient = new ExHttpClient(); var cookies = httpClient.GetCookiesAsync(credentials).Result; var apiClient = new ExClient(); var firstFileId = apiClient.FileList(credentials, 0, 100).Result.Items.First().Id; var fileList = httpClient.GetObjectFileInfosAsync(firstFileId, cookies).Result; fileList.Should().NotBeEmpty(); }
static void Main(string[] args) { var credentials = CredentialsProvider.Instance.GetCredentials(); var httpClient = new ExHttpClient(); var cookies = httpClient.GetCookiesAsync(credentials).Result; var apiClient = new ExClient(); var firstFileId = apiClient.FileList(credentials, 0, 100).Result.Items.First().Id; var fileInfo = httpClient.GetObjectFileInfosAsync(92489544, cookies).Result.Last(); // var downloadFirstChunk = httpClient.DownloadFileAsync(fileInfo, cookies: cookies).Result; // var downloadTracker = new DownloadTracker(exBaseAddress: "http://www.ex.ua/"); // var cts = new CancellationTokenSource(); //downloadTracker.StartOrResumeDownload(fileInfo, cts.Token).Wait(); System.Console.ReadKey(); }
public static void ClientPerformsFileDownloadCorrectly() { var credentials = CredentialsProvider.Instance.GetCredentials(); var httpClient = new ExHttpClient(); var cookies = httpClient.GetCookiesAsync(credentials).Result; var apiClient = new ExClient(); var firstFileId = apiClient.FileList(credentials, 0, 100).Result.Items.First().Id; var fileInfo = httpClient.GetObjectFileInfosAsync(72195263, cookies).Result.Last(); //for (int i = 0; i < 10; i++) { // var downloadFirstChunk = httpClient.DownloadFileAsync(fileInfo, cookies: cookies).Result; } }