コード例 #1
0
        public void TestPropertyValue()
        {
            int PROPERTY_VALUE = 10;
            PointSystemConfiguration configuration = new PointSystemConfiguration();

            configuration.PropertyValue = PROPERTY_VALUE;
            Assert.AreEqual(PROPERTY_VALUE, configuration.PropertyValue);
        }
コード例 #2
0
        public void TestPropertyName()
        {
            string PROPERTY_NAME = "loyalty";
            PointSystemConfiguration configuration = new PointSystemConfiguration();

            configuration.PropertyName = PROPERTY_NAME;
            Assert.AreEqual(PROPERTY_NAME, configuration.PropertyName);
        }
コード例 #3
0
        public void TestUpdateConfiguration()
        {
            configurationManager.AddConfiguration(configurationDTO);
            configurationDTO.PropertyValue = 0;
            configurationManager.UpdateConfiguration(configurationDTO);
            PointSystemConfiguration result = configurationManager.GetByPropertyName(PROPERTY_NAME);

            Assert.AreEqual(0, result.PropertyValue);
        }
コード例 #4
0
        public PointSystemConfigurationDTO GetPointSystemConfiguration()
        {
            PointSystemConfiguration result = pointSystemManager.GetByPropertyName(ESportUtils.LOYALTY_PROPERTY_NAME);

            return(new PointSystemConfigurationDTO()
            {
                PropertyName = result.PropertyName, PropertyValue = result.PropertyValue
            });
        }
コード例 #5
0
 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);
         }
 }
コード例 #6
0
 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);
         }
     }
 }
コード例 #7
0
 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;
 }
コード例 #11
0
        public void TestPropertyId()
        {
            PointSystemConfiguration configuration = new PointSystemConfiguration();

            Assert.IsNotNull(configuration.Id);
        }