Exemple #1
0
        public IHttpActionResult UpdateValue(EAV.Store.IStoreValue value)
        {
            try
            {
                valueClient.UpdateValue(value);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
Exemple #2
0
        public void UpdateValue()
        {
            var    dbValue  = SelectRandomItem(this.DbContext.Values.AsEnumerable().Where(it => it.Unit != null));
            string oldValue = dbValue.Raw_Value;

            EAV.Store.Clients.IValueStoreClient client = factory.Create <EAV.Store.Clients.IValueStoreClient>();

            var value = (EAVStoreLibrary.StoreValue)dbValue;

            value.RawValue = oldValue.Flip();

            client.UpdateValue(value);

            ResetDatabaseContext();

            dbValue = this.dbContext.Values.Single(it => it.Instance_ID == value.InstanceID && it.Attribute_ID == value.AttributeID);

            Assert.AreEqual(value.RawValue, dbValue.Raw_Value);
            Assert.AreNotEqual(oldValue, dbValue.Raw_Value);
        }