public async Task NotifyPropertyChangedTest() { var id = "TPv9dh822VA"; var client = new UnsplasharpClient(Credentials.ApplicationId); var photo = await client.GetPhoto(id); photo.Downloads = 20000; }
public async Task GetPhotoTest() { //var id = "TPv9dh822VA"; var id = "qcs09SwNPHY"; var client = new UnsplasharpClient(Credentials.ApplicationId); var photo = await client.GetPhoto(id); // Custom size var photoWidth = await client.GetPhoto(id, width : 400); var photoWidthHeight = await client.GetPhoto(id, width : 500, height : 500); // Custom size + cropped var photoCropped = await client.GetPhoto(id, 600, 600, 10, 10, 100, 100); Assert.IsNotNull(photo); Assert.IsNotNull(photoWidth); Assert.IsNotNull(photoWidthHeight); Assert.IsNotNull(photoCropped); Assert.IsNotNull(photoWidth.Urls.Custom); Assert.IsNotNull(photoWidthHeight.Urls.Custom); Assert.IsNotNull(photoCropped.Urls.Custom); }
public async Task <List <InstaBot.Models.Photo> > SearchNewPhotosAsync(string stockCategoryName, int photoCount, List <string> downloadedPhotos) { List <InstaBot.Models.Photo> photoList = new List <InstaBot.Models.Photo>(); int page = ApiConstans.PHOTO_SEARCH_DEFAULT_PAGE; while (photoList.Count == 0) { photoList = await this.SearchPhotosAsync(stockCategoryName, page); photoList.RemoveAll(p => downloadedPhotos.Contains(p.Id)); page++; } photoList = photoList.Take(photoCount).ToList(); for (int i = 0; i < photoList.Count; i++) { //for missing information photoList[i] = (await stockClient.GetPhoto(photoList[i].Id)).ToPhoto(); } return(photoList); }
private async Task <Photo> GetPhoto(string id) { return(await _client.GetPhoto(id)); }