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

            PhotoCollection photos = f.PeopleGetPhotos("me");
        }
예제 #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.");
        }
예제 #4
0
        public void PhotosGetNotInSetNoParamsTest()
        {
            Flickr f = TestData.GetAuthInstance();

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

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

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

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

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

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

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

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

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

            f.PlacesPlacesForUser();
        }