public void UpdateLayerTest() { var oldId = "oldId"; var newId = "newId"; var layer = new Layer() { Id = newId, Type = Layer.TYPE_DB_TABLE, Name = "name", Source = "source", Fields = new List <LayerField>() { new LayerField() { FieldName = "id", DataType = "UUID", FieldSize = 64 } } }; var url = String.Join("/", new string[] { urlPrefix, db1, "layers", oldId }); 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); db.UpdateLayer(oldId, layer); } catch (Exception ex) { Assert.Fail(ex.Message); } }