コード例 #1
0
        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.");
        }
コード例 #2
0
ファイル: EntityController.cs プロジェクト: tnewell/MicroEAV
 public IHttpActionResult RetrieveEntity(int id)
 {
     try
     {
         return(Ok <EAV.Store.IStoreEntity>(entityClient.RetrieveEntity(id)));
     }
     catch (Exception ex)
     {
         return(InternalServerError(ex));
     }
 }
コード例 #3
0
        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.");
            }
        }