Exemple #1
0
        public void RetrieveNonExistentValue()
        {
            EAV.Store.Clients.IValueStoreClient client = factory.Create <EAV.Store.Clients.IValueStoreClient>();

            var value = client.RetrieveValue(-1, -1);

            Assert.IsNull(value, "Unexpected value object retrieved.");
        }
Exemple #2
0
 public IHttpActionResult RetrieveValue(int instance, int attribute)
 {
     try
     {
         return(Ok <EAV.Store.IStoreValue>(valueClient.RetrieveValue(attribute, instance)));
     }
     catch (Exception ex)
     {
         return(InternalServerError(ex));
     }
 }
Exemple #3
0
        public void RetrieveRandomValue()
        {
            EAVStoreClient.Value dbValue = SelectRandomItem(this.DbContext.Values);

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

                var value = client.RetrieveValue(dbValue.Attribute_ID, dbValue.Instance_ID);

                Assert.IsNotNull(value, "Failed to retrieve value [{0}, {1}].", dbValue.Attribute_ID, dbValue.Instance_ID);
                Assert.AreEqual(dbValue.Attribute_ID, value.AttributeID, "Attribute ID values do not match.");
                Assert.AreEqual(dbValue.Instance_ID, value.InstanceID, "Instance ID values do not match.");
            }
            else
            {
                Assert.Inconclusive("No values were found in the database.");
            }
        }