Example #1
0
        public void OAuthPeopleGetPhotosBasicTest()
        {
            Flickr f = TestData.GetAuthInstance();

            PhotoCollection photos = f.PeopleGetPhotos("me");
        }
Example #2
0
        public void PhotosGetUntaggedAllParamsTest()
        {
            Flickr f = TestData.GetAuthInstance();

            var photos = f.PhotosGetUntagged(1, 10, PhotoSearchExtras.All);
        }
        public void ReflectionMethodsCheckWeSupportAndParametersMatch()
        {
            List <string> exceptions = new List <string>();

            exceptions.Add("flickr.photos.getWithGeoData");
            exceptions.Add("flickr.photos.getWithouGeoData");
            exceptions.Add("flickr.photos.search");
            exceptions.Add("flickr.photos.getNotInSet");
            exceptions.Add("flickr.photos.getUntagged");

            Flickr f = TestData.GetInstance();

            MethodCollection methodNames = f.ReflectionGetMethods();

            Assert.IsNotNull(methodNames, "Should not be null");
            Assert.AreNotEqual(0, methodNames.Count, "Should return some method names.");
            Assert.IsNotNull(methodNames[0], "First item should not be null");

            Type type = typeof(Flickr);

            MethodInfo[] methods = type.GetMethods();

            int failCount = 0;

            foreach (string methodName in methodNames)
            {
                bool   found     = false;
                bool   foundTrue = false;
                string trueName  = methodName.Replace("flickr.", "").Replace(".", "").ToLower();
                foreach (MethodInfo info in methods)
                {
                    if (trueName == info.Name.ToLower())
                    {
                        found = true;
                        break;
                    }
                }
                // Check the number of arguments to see if we have a matching method.
                if (found && !exceptions.Contains(methodName))
                {
                    Method method = f.ReflectionGetMethodInfo(methodName);
                    foreach (MethodInfo info in methods)
                    {
                        if (method.Arguments.Count - 1 == info.GetParameters().Length)
                        {
                            foundTrue = true;
                            break;
                        }
                    }
                }
                if (!found)
                {
                    failCount++;
                    Console.WriteLine("Method '" + methodName + "' not found in FlickrNet.Flickr.");
                }
                if (found && !foundTrue)
                {
                    Console.WriteLine("Method '" + methodName + "' found but no matching method with all arguments.");
                }
            }

            Assert.AreEqual(0, failCount, "FailCount should be zero. Currently " + failCount + " unsupported methods found.");
        }
Example #4
0
        public void PhotosGetNotInSetNoParamsTest()
        {
            Flickr f = TestData.GetAuthInstance();

            var photos = f.PhotosGetNotInSet();
        }
Example #5
0
        public void PhotosGetRecentBlankTest()
        {
            var photos = TestData.GetInstance().PhotosGetRecent();

            Assert.IsNotNull(photos);
        }
Example #6
0
        public void PeopleGetPhotosOfAuthRequired()
        {
            Flickr f = TestData.GetInstance();

            PeoplePhotoCollection p = f.PeopleGetPhotosOf();
        }
Example #7
0
        public void AuthCheckTokenInvalidTokenTest()
        {
            string token = "abcdefgh";

            Should.Throw <LoginFailedInvalidTokenException>(() => TestData.GetOldSignedInstance().AuthCheckToken(token));
        }
Example #8
0
 public void PeopleGetInfoBlankDate()
 {
     var p = TestData.GetInstance().PeopleGetInfo("18387778@N00");
 }
Example #9
0
 public void PeopleGetInfoZeroDate()
 {
     var p = TestData.GetInstance().PeopleGetInfo("47963952@N03");
 }
Example #10
0
        public void UrlsGetGroupTest()
        {
            string url = TestData.GetInstance().UrlsGetGroup(TestData.GroupId);

            Assert.AreEqual <string>("http://www.flickr.com/groups/florus/", url);
        }
Example #11
0
        public void UrlsGetUserPhotosTest()
        {
            string url = TestData.GetInstance().UrlsGetUserPhotos(TestData.TestUserId);

            Assert.AreEqual <string>("http://www.flickr.com/photos/samjudson/", url);
        }
Example #12
0
 public void AuthGetFrobSignRequiredTest()
 {
     string frob = TestData.GetInstance().AuthGetFrob();
 }
Example #13
0
        public void AuthCheckTokenInvalidTokenTest()
        {
            string token = "abcdefgh";

            TestData.GetOldSignedInstance().AuthCheckToken(token);
        }
Example #14
0
        public void AuthCheckTokenSignRequiredTest()
        {
            string token = "abcdefgh";

            TestData.GetInstance().AuthCheckToken(token);
        }
Example #15
0
        public void AuthCalcUrlSignRequiredTest()
        {
            string frob = "abcdefgh";

            string url = TestData.GetInstance().AuthCalcUrl(frob, AuthLevel.Read);
        }
Example #16
0
        public void PlacesPlacesForUserAuthenticationRequiredTest()
        {
            Flickr f = TestData.GetInstance();

            f.PlacesPlacesForUser();
        }