public void TestNewRawPostSubmit() { //Arrange & Act var raw = Factual.RequestPost("/t/us-sandbox/submit", new Dictionary <string, object> { { "values", new Dictionary <string, object> { { "name", "Factual North" }, { "address", "1 North Pole" }, { "latitude", 90 }, { "longitude", 0 } } }, { "user", "test_driver_user" } }, new Dictionary <string, object>()); //Assert AssertReceivedOkResponse(raw); }
public void TestDeprecatedEntity() { // Arrange & Act var response = Factual.FetchRow("places", "15442594-6f41-4ba3-9c02-b4ca6e663fcd"); // Assert AssertReceivedOkResponse(response); }
public void TestBoostNoUserNoSearch() { // Arrange & Act var response = Factual.Boost("us-sandbox", "03c26917-5d66-4de9-96bc-b13066173c65"); // Assert AssertReceivedOkResponse(response); }
public void TestBoostNoUser() { // Arrange & Act var response = Factual.Boost("us-sandbox", "03c26917-5d66-4de9-96bc-b13066173c65", "Local Business Data, Global"); // Assert AssertReceivedOkResponse(response); }
public void TestMonetize() { //Arrange var response = Factual.Monetize(new Query().Field("place_locality").Equal("Los Angeles")); //Assert AssertReceivedOkResponse(response); }
public void Init() { if (string.IsNullOrWhiteSpace(OAuthKey) || string.IsNullOrEmpty(OAuthSecret)) throw new ConfigurationException("please specify oauth keys"); Factual = new Factual(OAuthKey, OAuthSecret); Factual.Debug = true; }
public void TestRowQueryResponse() { //Arrange var response = Factual.FetchRow("places", "03c26917-5d66-4de9-96bc-b13066173c65"); //Assert AssertReceivedOkResponse(response); }
public void TestFlagOther() { //Arrange var response = Factual.FlagOther("us-sandbox", "2ca7228a-a77c-448e-a96f-3e1731573fff", new Metadata().User("test_driver_user")); //Assert AssertReceivedOkResponse(response); }
public void TestMonetizeByBusiness() { //Arrange var response = Factual.Monetize(new Query().Field("place_factual_id").Equal("3226fac0-2f85-49d7-bc67-288fb2fc52ee")); //Assert AssertReceivedOkResponse(response); }
public void TestIncludesAnyRowFilter() { //Arrange var response = Factual.Fetch("places", new Query().Field("category_ids").IncludesAny(10, 100)); //Assert AssertReceivedOkResponse(response); }
public void TestCoreExample1() { //Arrange & Act var response = Factual.Fetch("places", new Query().Field("country").Equal("US")); //Assert AssertReceivedOkResponse(response); }
public void TestReverseGeocode() { //Arrange var result = Factual.ReverseGeocode(new Point(34.06021, -118.41828)); //Assert AssertReceivedOkResponse(result); }
public void TestFlagOther() { // Arrange var response = Factual.FlagOther("us-sandbox", "4e4a14fe-988c-4f03-a8e7-0efc806d0a7f", new Metadata().User("test_driver_user")); // Assert AssertReceivedOkResponse(response); }
public void TestCrosswalkEx1() { //Arrange & Act var response = Factual.Fetch("crosswalk", new Query().Field("factual_id").Equal("c730d193-ba4d-4e98-8620-29c672f2f117")); AssertReceivedOkResponse(response); AssertNotEmpty(response); AssertCrosswalkResult(response, "factual_id", "c730d193-ba4d-4e98-8620-29c672f2f117"); }
public void TestCrosswalkEx3() { //Arrange var response = Factual.Fetch("crosswalk", new Query().Field("namespace").Equal("foursquare") .Field("namespace_id").Equal("4ae4df6df964a520019f21e3")); AssertReceivedOkResponse(response); AssertNotEmpty(response); }
public void TestSimpleTel() { //Arrange & Act var response = Factual.Fetch("places", new Query().Field("tel").BeginsWith("(212)")); AssertReceivedOkResponse(response); AssertNotEmpty(response); AssertStartsWith(response, "tel", "(212)"); }
public void TestSchema() { //Arrange var result = Factual.Schema("restaurants"); dynamic json = JsonConvert.DeserializeObject(result); //Assert Assert.AreEqual("ok", (string)json.status); }
public void QueryWithRectangleFilter() { var filter = new Rectangle(47.622525, -122.353599, 47.618244, -122.340339); String result = Factual.Query("t/places", filter); dynamic json = JsonConvert.DeserializeObject(result); Assert.AreEqual("ok", (string)json.status); Assert.IsTrue(result.Contains("Space Needle")); }
public void TestDiffsNoResponse() { //Arrange DiffsQuery diffs = new DiffsQuery() .After(1304916463822) .Before(1304917903834); //Act var response = Factual.Fetch("places-us", diffs); }
public void TestCoreExample3NonEnglish() { //Arrange & Act var response = Factual.Fetch("global", new Query().Search("משה")); Factual.Debug = true; //Assert AssertReceivedOkResponse(response); }
public HealthCareProviderRepository() { if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["FactualAuthKey"]) || string.IsNullOrEmpty(ConfigurationManager.AppSettings["FactualAuthSecret"])) { throw new ConfigurationErrorsException("Missing Factual API keys in your web.config."); } _factual = new Factual(ConfigurationManager.AppSettings["FactualAuthKey"], ConfigurationManager.AppSettings["FactualAuthSecret"]); }
public void TestFlagInaccurate() { // Arrange var response = Factual.FlagInaccurate("us-sandbox", "4e4a14fe-988c-4f03-a8e7-0efc806d0a7f", new List <String> { "name", "hours" }, new Metadata().User("test_driver_user")); // Assert AssertReceivedOkResponse(response); }
public void Init() { if (string.IsNullOrWhiteSpace(OAuthKey) || string.IsNullOrEmpty(OAuthSecret)) { throw new ConfigurationErrorsException("please specify oauth keys"); } Factual = new Factual(OAuthKey, OAuthSecret); Factual.Debug = true; }
public void TestSearchExact() { // Arrange & Act var response = Factual.Fetch("places", new Query().SearchExact("a b c")); var raw = Factual.RawQuery("t/places", "q=\"a b c\""); // Assert AssertReceivedOkResponse(response); Assert.AreEqual(response, raw); }
public void TestNewRawGetComplex() { // Arrange var CategoryLabel = "Food & Beverage"; var Offset = 0; var Lat = 34.06018; var Lng = -118.41835; var Radius = 5000; // Act var result = Factual.RawQuery("t/places", new Dictionary <string, object> { { "filters", new Dictionary <string, object> { { "category_labels", CategoryLabel } } }, { "limit", 5 }, { "offset", Offset }, { "include_count", (Offset == 0).ToString() }, { "geo", new Dictionary <string, object> { { "$circle", new Dictionary <string, object> { { "$center", "[" + Lat + "," + Lng + "]" }, { "$meters", Radius } } } } } } ); var raw = Factual.RawQuery("t/places", "filters={\"category_labels\":\"Food %26 Beverage\"}&limit=5&offset=0&include_count=true&geo={\"$circle\":{\"$center\":[34.06018,-118.41835],\"$meters\":5000}}"); // Assert AssertReceivedOkResponse(result); AssertReceivedOkResponse(raw); Assert.AreEqual(result, raw); }
public void BadAuthenticatedRequest() { // Arrange var factual = new Factual("badkey", "badsecret"); // Assert var exception = Assert.Throws<FactualApiException>( () => factual.Fetch("places",new Query().Field("region").Equal("CA"))); Assert.AreEqual(exception.StatusCode, HttpStatusCode.Unauthorized); }
public void GeopulseTest() { //Arrange var result = Factual.Geopulse(new Geopulse(new Point(34.06021, -118.41828)).Only("income", "housing")); dynamic json = JsonConvert.DeserializeObject(result); //Assert Assert.AreEqual("ok", (string)json.status); }
public void BadAuthenticatedRequest() { //Arrange var factual = new Factual("badkey", "badsecret"); //Assert var exception = Assert.Throws <FactualApiException>( () => factual.Fetch("places", new Query().Field("region").Equal("CA"))); Assert.AreEqual(exception.StatusCode, HttpStatusCode.Unauthorized); }
public void TestRowQueryOnlyResponse() { //Arrange var rowQuery = new RowQuery(); rowQuery.Only("name", "address", "region", "postcode"); var response = Factual.FetchRow("places", "03c26917-5d66-4de9-96bc-b13066173c65", rowQuery); //Assert AssertReceivedOkResponse(response); }
public void TestGeocode() { //Arrange var response = Factual.ReverseGeocode(new Point(Latitude, Longitude)); dynamic json = JsonConvert.DeserializeObject(response); //Assert AssertReceivedOkResponse(response); Assert.IsTrue(((ICollection <JToken>)json.response.data).Count > 0); }
public void TestCrosswalkLimit() { //Arrange var response = Factual.Fetch("crosswalk", new Query().Field("factual_id").Equal("c730d193-ba4d-4e98-8620-29c672f2f117").Limit(1)); AssertReceivedOkResponse(response); AssertNotEmpty(response); dynamic json = JsonConvert.DeserializeObject(response); Assert.IsTrue(((int)json.response.included_rows) == 1); }
public void TestSubmitError() { // Arrange Submit submit = new Submit().RemoveValue("longitude"); // Act var response = Factual.Submit("us-sandbox", "randomwrongid", submit, new Metadata().User("test_driver_user")); // Assert AssertReceivedOkResponse(response); }