public IHttpActionResult UpdateEntity(EAV.Store.IStoreEntity entity) { try { entityClient.UpdateEntity(entity); return(Ok()); } catch (Exception ex) { return(InternalServerError(ex)); } }
public void UpdateEntity() { var dbEntity = SelectRandomItem(this.DbContext.Entities); string oldDescriptor = dbEntity.Descriptor; EAV.Store.Clients.IEntityStoreClient client = factory.Create <EAV.Store.Clients.IEntityStoreClient>(); var entity = (EAVStoreLibrary.StoreEntity)dbEntity; entity.Descriptor = oldDescriptor.Flip(); client.UpdateEntity(entity); ResetDatabaseContext(); dbEntity = this.dbContext.Entities.Single(it => it.Entity_ID == entity.EntityID); Assert.AreEqual(entity.Descriptor, dbEntity.Descriptor); Assert.AreNotEqual(oldDescriptor, dbEntity.Descriptor); }