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 FullTextSearch() { // Arrange var filter = new SearchFilter("vegan,Los Angeles"); // Act string result = Factual.Query("t/restaurants", filter); dynamic json = JsonConvert.DeserializeObject(result); // Assert Assert.AreEqual("ok", (string)json.status); }
public void QueryWithGeoFilter() { // Arrange var filter = new GeoFilter(34.06018, -118.41835, 500); // Act string result = Factual.Query("t/global", filter); dynamic json = JsonConvert.DeserializeObject(result); // Assert Assert.AreEqual("ok", (string)json.status); }
public void QueryWithBeginFilter() { // Arrange var filter = new RowFilter("name", "$bw", "$Star"); // Act string result = Factual.Query("t/global", filter); dynamic json = JsonConvert.DeserializeObject(result); // Assert Assert.AreEqual("ok", (string)json.status); }
public void QueryWithSimpleRowFilter() { // Arrange var filter = new RowFilter("country", "US"); // Act string result = Factual.Query("t/global", filter); dynamic json = JsonConvert.DeserializeObject(result); // Assert Assert.AreEqual("ok", (string)json.status); }
public void GeoAndRowFilterTest() { // Arrange var filter = new RowFilter("name", "Stand"); var filter2 = new GeoFilter(34.06018, -118.41835, 5000); // Act string result = Factual.Query("t/restaurants", filter, filter2); dynamic json = JsonConvert.DeserializeObject(result); // Assert Assert.AreEqual("ok", (string)json.status); }
public void MultipleFiltersTest() { // Arrange var filter = new RowFilter("name", "$bw", "Star"); var filter2 = new Filter("include_count", "true"); // Act string result = Factual.Query("t/restaurants", filter, filter2); dynamic json = JsonConvert.DeserializeObject(result); // Assert Assert.AreEqual("ok", (string)json.status); }
public void ParametersWithConditionalOperators() { // Arrange var filter = new FilterGroup(new List <IFilter> { new RowFilter("name", "$search", "McDonald's"), new RowFilter("category", "$bw", "Food & Beverage") }); // Act string result = Factual.Query("t/global", filter); dynamic json = JsonConvert.DeserializeObject(result); // Assert Assert.AreEqual("ok", (string)json.status); }