public void QueryJSONTest() { var id = "id"; var point = new Point(new GeographicPosition(30.0, 110.0)); var feature = new Feature(point); var features = new List <Feature>(); features.Add(feature); var collection = new FeatureCollection(features); var array = new FeatureCollection[] { collection }; var expected = JsonConvert.SerializeObject(array); var url = String.Join("/", new string[] { urlPrefix, db1, "layers", id, "data" }); var handler = new MockHttpHandler(url, "POST", (req, res, param) => { var result = new RestResult(); result.Success = true; result.Count = 1; result.Data = JsonConvert.SerializeObject(array); return(JsonConvert.SerializeObject(result)); }); mockServer.AddRequestHandler(handler); try { var db = new MapDB(db1); var filter = new QueryFilter(); var actual = db.QueryJSON(filter, 0, 10, new string[] { id }); Assert.AreEqual(expected, actual); } catch (Exception ex) { Assert.Fail(ex.Message); } }