public void UpdateContext() { var dbContext = SelectRandomItem(this.DbContext.Contexts); string oldName = dbContext.Name; string oldDataName = dbContext.Data_Name; string oldDisplayText = dbContext.Display_Text; EAV.Store.Clients.IContextStoreClient client = factory.Create <EAV.Store.Clients.IContextStoreClient>(); var context = (EAVStoreLibrary.StoreContext)dbContext; context.Name = oldName.Flip(); context.DataName = oldDataName.Flip(); context.DisplayText = oldDisplayText.Flip(); client.UpdateContext(context); ResetDatabaseContext(); dbContext = this.dbContext.Contexts.Single(it => it.Context_ID == context.ContextID); Assert.AreEqual(context.Name, dbContext.Name); Assert.AreNotEqual(oldName, dbContext.Name); Assert.AreEqual(context.DataName, dbContext.Data_Name); Assert.AreNotEqual(oldDataName, dbContext.Data_Name); Assert.AreEqual(context.DisplayText, dbContext.Display_Text); Assert.AreNotEqual(oldDisplayText, dbContext.Display_Text); }
public IHttpActionResult UpdateContext(EAV.Store.IStoreContext context) { try { contextClient.UpdateContext(context); return(Ok()); } catch (Exception ex) { return(InternalServerError(ex)); } }