public void Serialize_GeoValue_Success() { var filter = new QueryFilter("prop", QueryFilter.FilterOperator.Within(), new QueryFilter.GeoValue(10.0, 10.0, 5.0)); var json = JObject.FromObject(filter).ToString(); Trace.WriteLine(json); var expectedJson = "{\r\n"+ " \"property_name\": \"prop\",\r\n"+ " \"operator\": \"within\",\r\n"+ " \"property_value\": {\r\n"+ " \"coordinates\": [\r\n"+ " 10.0,\r\n"+ " 10.0\r\n"+ " ],\r\n"+ " \"max_distance_miles\": 5.0\r\n"+ " }\r\n"+ "}"; Assert.AreEqual(expectedJson, json); }
public void Serialize_SimpleValue_Success() { var filter = new QueryFilter("prop", QueryFilter.FilterOperator.Equals(), "val"); var json = JObject.FromObject(filter).ToString(); var expectedJson = "{\r\n" + " \"property_name\": \"prop\",\r\n"+ " \"operator\": \"eq\",\r\n"+ " \"property_value\": \"val\"\r\n"+ "}"; Assert.AreEqual(expectedJson, json); }