public void CountTest() { var expected = 3; var url = String.Join("/", new string[] { urlPrefix1, layer1, "data" }); var handler = new MockHttpHandler(url, "POST", (req, res, param) => { var result = new RestResult(); result.Success = true; result.Data = expected; return(JsonConvert.SerializeObject(result)); }); mockServer.AddRequestHandler(handler); try { var db = new MapDB(db1); var layer = new FeatureLayer(layer1, db); var actual = layer.Count(null); Assert.AreEqual(expected, actual); } catch (Exception ex) { Assert.Fail(ex.Message); } }