Example #1
0
        public void RetrieveNonExistentAttribute()
        {
            EAV.Store.Clients.IAttributeStoreClient client = factory.Create <EAV.Store.Clients.IAttributeStoreClient>();

            var attribute = client.RetrieveAttribute(-1);

            Assert.IsNull(attribute, "Unexpected attribute object retrieved.");
        }
Example #2
0
 public IHttpActionResult RetrieveAttribute(int id)
 {
     try
     {
         return(Ok <EAV.Store.IStoreAttribute>(attributeClient.RetrieveAttribute(id)));
     }
     catch (Exception ex)
     {
         return(InternalServerError(ex));
     }
 }
Example #3
0
        public void RetrieveRandomAttribute()
        {
            var dbAttribute = SelectRandomItem(this.DbContext.Attributes);

            if (dbAttribute != null)
            {
                EAV.Store.Clients.IAttributeStoreClient client = factory.Create <EAV.Store.Clients.IAttributeStoreClient>();

                var attribute = client.RetrieveAttribute(dbAttribute.Attribute_ID);

                Assert.IsNotNull(attribute, "Failed to retrieve attribute {0}.", dbAttribute.Attribute_ID);
                Assert.AreEqual(dbAttribute.Attribute_ID, attribute.AttributeID, "Attribute ID values do not match.");
            }
            else
            {
                Assert.Inconclusive("No attributes were found in the database.");
            }
        }