public IHttpActionResult UpdateSubject(EAV.Store.IStoreSubject subject) { try { subjectClient.UpdateSubject(subject); return(Ok()); } catch (Exception ex) { return(InternalServerError(ex)); } }
public void UpdateSubject() { var dbSubject = SelectRandomItem(this.DbContext.Subjects); string oldIdentifier = dbSubject.Identifier; EAV.Store.Clients.ISubjectStoreClient client = factory.Create <EAV.Store.Clients.ISubjectStoreClient>(); var subject = (EAVStoreLibrary.StoreSubject)dbSubject; subject.Identifier = oldIdentifier.Flip(); client.UpdateSubject(subject); ResetDatabaseContext(); dbSubject = this.dbContext.Subjects.Single(it => it.Subject_ID == subject.SubjectID); Assert.AreEqual(subject.Identifier, dbSubject.Identifier); Assert.AreNotEqual(oldIdentifier, dbSubject.Identifier); }