public void GisEntity_EntityController_StartStopEdit() { GisEntityController controller = new GisEntityController(); Assert.AreEqual(false, controller.IsBeingEdited); Assert.AreEqual(false, controller.IsInEditOperation); controller.StartEdit(); Assert.AreEqual(true, controller.IsBeingEdited); Assert.AreEqual(true, controller.IsInEditOperation); controller.StopEdit(false); Assert.AreEqual(false, controller.IsBeingEdited); Assert.AreEqual(false, controller.IsInEditOperation); }
public void GisEntity_EntityController_CreateDelete() { GisEntityController controller = new GisEntityController(); controller.StartEdit(); GisEntity entity = controller.Create(); entity.EntityCode = "TST"; entity.EntityName = "Teste"; entity.EntityFeatureDataset = string.Empty; entity.EntityFeatureClass = "TTST_TESTE"; entity.EntityClassExtension = string.Empty; entity.EntityLevel = 109; entity.EntityRanking = 0; entity.EntityType = "Alfanumérica"; controller.Update(entity); Assert.AreEqual("TST", entity.EntityCode); Assert.AreEqual("Teste", entity.EntityName); Assert.AreEqual(string.Empty, entity.EntityFeatureDataset); Assert.AreEqual("TTST_TESTE", entity.EntityFeatureClass); Assert.AreEqual(string.Empty, entity.EntityClassExtension); Assert.AreEqual(109, entity.EntityLevel); Assert.AreEqual(0, entity.EntityRanking); Assert.AreEqual("Alfanumérica", entity.EntityType); controller.Delete(entity); IQueryFilter filter = new QueryFilterClass(); filter.WhereClause = "ENT_CD_ENTIDADE = 'TST'"; List <GisEntity> entities = controller.Filter(filter); Assert.AreEqual(0, entities.Count); controller.StopEdit(true); }
public void GisEntity_EntityController_SetValue() { GisEntityController controller = new GisEntityController(); controller.StartEdit(); GisEntity entity = controller.Single("TENT"); Assert.AreEqual("TENT", entity.EntityCode); Assert.AreEqual("Entidades", entity.EntityName); Assert.AreEqual(String.Empty, entity.EntityFeatureDataset); Assert.AreEqual("TENT_ENTIDADES", entity.EntityFeatureClass); Assert.AreEqual(String.Empty, entity.EntityClassExtension); Assert.AreEqual(99, entity.EntityLevel); Assert.AreEqual(5, entity.EntityRanking); Assert.AreEqual("Alfanumérica", entity.EntityType); #region settting the values entity.EntityFeatureDataset = "TESTE_SET"; Assert.AreEqual("TESTE_SET", entity.EntityFeatureDataset); entity.EntityType = "Georreferenciada"; Assert.AreEqual("Georreferenciada", entity.EntityType); controller.Update(entity); #endregion #region setting them back entity.EntityFeatureDataset = String.Empty; Assert.AreEqual(String.Empty, entity.EntityFeatureDataset); entity.EntityType = "Alfanumérica"; Assert.AreEqual("Alfanumérica", entity.EntityType); controller.Update(entity); #endregion controller.StopEdit(true); }
public void GisEntity_EntityController_CreateDelete() { GisEntityController controller = new GisEntityController(); controller.StartEdit(); GisEntity entity = controller.Create(); entity.EntityCode = "TST"; entity.EntityName = "Teste"; entity.EntityFeatureDataset = string.Empty; entity.EntityFeatureClass = "TTST_TESTE"; entity.EntityClassExtension = string.Empty; entity.EntityLevel = 109; entity.EntityRanking = 0; entity.EntityType = "Alfanumérica"; controller.Update(entity); Assert.AreEqual("TST", entity.EntityCode); Assert.AreEqual("Teste", entity.EntityName); Assert.AreEqual(string.Empty, entity.EntityFeatureDataset); Assert.AreEqual("TTST_TESTE", entity.EntityFeatureClass); Assert.AreEqual(string.Empty, entity.EntityClassExtension); Assert.AreEqual(109, entity.EntityLevel); Assert.AreEqual(0, entity.EntityRanking); Assert.AreEqual("Alfanumérica", entity.EntityType); controller.Delete(entity); IQueryFilter filter = new QueryFilterClass(); filter.WhereClause = "ENT_CD_ENTIDADE = 'TST'"; List<GisEntity> entities = controller.Filter(filter); Assert.AreEqual(0, entities.Count); controller.StopEdit(true); }