Exemple #1
0
        public void AddLayerFieldTest()
        {
            var url     = String.Join("/", new string[] { urlPrefix1, layer1, "fields" });
            var handler = new MockHttpHandler(url, "POST", (req, res, param) =>
            {
                var result     = new RestResult();
                result.Success = true;
                return(JsonConvert.SerializeObject(result));
            });

            mockServer.AddRequestHandler(handler);

            try
            {
                var db    = new MapDB(db1);
                var layer = new FeatureLayer(layer1, db);
                var field = new LayerField()
                {
                    FieldName = "fieldName",
                    DataType  = "INT",
                    FieldSize = 64
                };
                layer.AddLayerField(field);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }