Example #1
0
        public void PeopleGetPhotosBasicTest()
        {
            PhotoCollection photos = AuthInstance.PeopleGetPhotos();

            Assert.IsNotNull(photos);
            Assert.AreNotEqual(0, photos.Count, "Count should not be zero.");
            Assert.IsTrue(photos.Total > 1000, "Total should be greater than 1000.");
        }
Example #2
0
        public void ShouldReturnReturnPhotosForAuthenticatedUser()
        {
            var photos = AuthInstance.PeopleGetPhotos(Data.UserId);

            Assert.IsNotNull(photos);
            Assert.IsNotEmpty(photos);

            Assert.IsTrue(photos.All(p => p.UserId == Data.UserId));
        }
Example #3
0
        public void PeopleGetPhotosFullParamTest()
        {
            PhotoCollection photos = AuthInstance.PeopleGetPhotos(TestData.TestUserId, SafetyLevel.Safe, new DateTime(2010, 1, 1),
                                                                  new DateTime(2012, 1, 1), new DateTime(2010, 1, 1),
                                                                  new DateTime(2012, 1, 1), ContentTypeSearch.All,
                                                                  PrivacyFilter.PublicPhotos, PhotoSearchExtras.All, 1, 20);

            Assert.IsNotNull(photos);
            Assert.AreEqual(20, photos.Count, "Count should be twenty.");
        }
        public void DownloadAndUploadImage()
        {
            var photos = AuthInstance.PeopleGetPhotos(PhotoSearchExtras.Small320Url);

            var photo = photos.First();
            var url   = photo.Small320Url;

            var client = new WebClient();
            var data   = client.DownloadData(url);

            var ms = new MemoryStream(data)
            {
                Position = 0
            };

            var photoId = AuthInstance.UploadPicture(ms, "test.jpg", "Test Photo", "Test Description", "", false, false, false, ContentType.Photo, SafetyLevel.Safe, HiddenFromSearch.Hidden);

            Assert.IsNotNull(photoId, "PhotoId should not be null");

            // Cleanup
            AuthInstance.PhotosDelete(photoId);
        }
Example #5
0
 public void OAuthPeopleGetPhotosBasicTest()
 {
     PhotoCollection photos = AuthInstance.PeopleGetPhotos("me");
 }