public void OAuthPeopleGetPhotosBasicTest() { Flickr f = TestData.GetAuthInstance(); PhotoCollection photos = f.PeopleGetPhotos("me"); }
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."); }
public void PhotosGetNotInSetNoParamsTest() { Flickr f = TestData.GetAuthInstance(); var photos = f.PhotosGetNotInSet(); }
public void PhotosGetRecentBlankTest() { var photos = TestData.GetInstance().PhotosGetRecent(); Assert.IsNotNull(photos); }
public void PeopleGetPhotosOfAuthRequired() { Flickr f = TestData.GetInstance(); PeoplePhotoCollection p = f.PeopleGetPhotosOf(); }
public void AuthCheckTokenInvalidTokenTest() { string token = "abcdefgh"; Should.Throw <LoginFailedInvalidTokenException>(() => TestData.GetOldSignedInstance().AuthCheckToken(token)); }
public void PeopleGetInfoBlankDate() { var p = TestData.GetInstance().PeopleGetInfo("18387778@N00"); }
public void PeopleGetInfoZeroDate() { var p = TestData.GetInstance().PeopleGetInfo("47963952@N03"); }
public void UrlsGetGroupTest() { string url = TestData.GetInstance().UrlsGetGroup(TestData.GroupId); Assert.AreEqual <string>("http://www.flickr.com/groups/florus/", url); }
public void UrlsGetUserPhotosTest() { string url = TestData.GetInstance().UrlsGetUserPhotos(TestData.TestUserId); Assert.AreEqual <string>("http://www.flickr.com/photos/samjudson/", url); }
public void AuthGetFrobSignRequiredTest() { string frob = TestData.GetInstance().AuthGetFrob(); }
public void AuthCheckTokenInvalidTokenTest() { string token = "abcdefgh"; TestData.GetOldSignedInstance().AuthCheckToken(token); }
public void AuthCheckTokenSignRequiredTest() { string token = "abcdefgh"; TestData.GetInstance().AuthCheckToken(token); }
public void AuthCalcUrlSignRequiredTest() { string frob = "abcdefgh"; string url = TestData.GetInstance().AuthCalcUrl(frob, AuthLevel.Read); }
public void PlacesPlacesForUserAuthenticationRequiredTest() { Flickr f = TestData.GetInstance(); f.PlacesPlacesForUser(); }