public void RetrieveNonExistentEntity() { EAV.Store.Clients.IEntityStoreClient client = factory.Create <EAV.Store.Clients.IEntityStoreClient>(); var entity = client.RetrieveEntity(-1); Assert.IsNull(entity, "Unexpected entity object retrieved."); }
public IHttpActionResult RetrieveEntity(int id) { try { return(Ok <EAV.Store.IStoreEntity>(entityClient.RetrieveEntity(id))); } catch (Exception ex) { return(InternalServerError(ex)); } }
public void RetrieveRandomEntity() { var dbEntity = SelectRandomItem(this.DbContext.Entities); if (dbEntity != null) { EAV.Store.Clients.IEntityStoreClient client = factory.Create <EAV.Store.Clients.IEntityStoreClient>(); var entity = client.RetrieveEntity(dbEntity.Entity_ID); Assert.IsNotNull(entity, "Failed to retrieve entity {0}.", dbEntity.Entity_ID); Assert.AreEqual(dbEntity.Entity_ID, entity.EntityID, "Entity ID values do not match."); } else { Assert.Inconclusive("No entities were found in the database."); } }