Beispiel #1
0
        public void PhotosGeoPhotosForLocationBasicTest()
        {
            var o = new PhotoSearchOptions
            {
                UserId  = TestData.TestUserId,
                HasGeo  = true,
                PerPage = 1,
                Extras  = PhotoSearchExtras.Geo
            };

            var photos = AuthInstance.PhotosSearch(o);
            var photo  = photos[0];

            var photos2 = AuthInstance.PhotosGeoPhotosForLocation(photo.Latitude, photo.Longitude, photo.Accuracy, PhotoSearchExtras.All, 0, 0);

            Assert.IsNotNull(photos2, "PhotosGeoPhotosForLocation should not return null.");
            Assert.IsTrue(photos2.Count > 0, "Should return one or more photos.");

            foreach (var p in photos2)
            {
                Assert.IsNotNull(p.PhotoId);
                Assert.AreNotEqual(0, p.Longitude);
                Assert.AreNotEqual(0, p.Latitude);
            }
        }
Beispiel #2
0
        public void PhotosForLocationReturnsPhotos()
        {
            var photos = Instance.PhotosSearch(new PhotoSearchOptions {
                HasGeo = true, UserId = TestData.TestUserId, Extras = PhotoSearchExtras.Geo, PerPage = 10
            });

            var geoPhoto = photos.First();

            var geoPhotos = AuthInstance.PhotosGeoPhotosForLocation(geoPhoto.Latitude, geoPhoto.Longitude,
                                                                    GeoAccuracy.Street, PhotoSearchExtras.None, 100, 1);

            Assert.IsTrue(geoPhotos.Select(p => p.PhotoId).Contains(geoPhoto.PhotoId));
        }