public void TestPropertyValue() { int PROPERTY_VALUE = 10; PointSystemConfiguration configuration = new PointSystemConfiguration(); configuration.PropertyValue = PROPERTY_VALUE; Assert.AreEqual(PROPERTY_VALUE, configuration.PropertyValue); }
public void TestPropertyName() { string PROPERTY_NAME = "loyalty"; PointSystemConfiguration configuration = new PointSystemConfiguration(); configuration.PropertyName = PROPERTY_NAME; Assert.AreEqual(PROPERTY_NAME, configuration.PropertyName); }
public void TestUpdateConfiguration() { configurationManager.AddConfiguration(configurationDTO); configurationDTO.PropertyValue = 0; configurationManager.UpdateConfiguration(configurationDTO); PointSystemConfiguration result = configurationManager.GetByPropertyName(PROPERTY_NAME); Assert.AreEqual(0, result.PropertyValue); }
public PointSystemConfigurationDTO GetPointSystemConfiguration() { PointSystemConfiguration result = pointSystemManager.GetByPropertyName(ESportUtils.LOYALTY_PROPERTY_NAME); return(new PointSystemConfigurationDTO() { PropertyName = result.PropertyName, PropertyValue = result.PropertyValue }); }
public void AddEntity(PointSystemConfiguration configuration) { using (var db = new ESportDbContext()) try { db.PointSystemConfigurations.Add(configuration); db.SaveChanges(); } catch (Exception e) { throw new RepositoryException("Error al agregar configuración al sistema", e); } }
public void UpdateEntity(PointSystemConfiguration configuration) { using (var db = new ESportDbContext()) { try { var confToUpdate = db.PointSystemConfigurations.Attach(configuration); confToUpdate.PropertyValue = configuration.PropertyValue; db.Entry(confToUpdate).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } catch (Exception e) { throw new RepositoryException("Error al actualizar configuración", e); } } }
public void RemoveEntity(PointSystemConfiguration configuration) { throw new RepositoryException("Error: operacion invalida para las configuraciones"); }
public void UpdateEntity(PointSystemConfiguration entity) { configuration = entity; }
public void RemoveEntity(PointSystemConfiguration entity) { configuration = null; }
public void AddEntity(PointSystemConfiguration entity) { configuration = entity; }
public void TestPropertyId() { PointSystemConfiguration configuration = new PointSystemConfiguration(); Assert.IsNotNull(configuration.Id); }