public void RowFilterSerializationNumeric() { // Arrange var filter = new RowFilter("rating", "$gte", 7.5); // Act var result = JsonConvert.SerializeObject(filter); // Assert Assert.AreEqual("{\"rating\":{\"$gte\":7.5}}", result); }
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-us", 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-us", filter, filter2); 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 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 RowFilterSerializationWithArray() { // Arrange var filter = new RowFilter("locality", "$nin", new[] {"Los Angeles", "Northridge"}); // Act var result = JsonConvert.SerializeObject(filter); // Assert Assert.AreEqual("{\"locality\":{\"$nin\":[\"Los Angeles\",\"Northridge\"]}}", result); }