예제 #1
0
        public void RetrieveNonExistentInstance()
        {
            EAV.Store.Clients.IInstanceStoreClient client = factory.Create <EAV.Store.Clients.IInstanceStoreClient>();

            var instance = client.RetrieveInstance(-1);

            Assert.IsNull(instance, "Unexpected instance object retrieved.");
        }
예제 #2
0
 public IHttpActionResult RetrieveInstance(int id)
 {
     try
     {
         return(Ok <EAV.Store.IStoreInstance>(instanceClient.RetrieveInstance(id)));
     }
     catch (Exception ex)
     {
         return(InternalServerError(ex));
     }
 }
예제 #3
0
        public void RetrieveRandomInstance()
        {
            EAV.Store.Clients.IInstanceStoreClient client = factory.Create <EAV.Store.Clients.IInstanceStoreClient>();

            var dbInstance = SelectRandomItem(this.DbContext.Instances);

            if (dbInstance != null)
            {
                var instance = client.RetrieveInstance(dbInstance.Instance_ID);

                Assert.IsNotNull(instance, "Failed to retrieve instance {0}.", dbInstance.Instance_ID);
                Assert.AreEqual(dbInstance.Instance_ID, instance.InstanceID, "Instance ID values do not match.");
            }
            else
            {
                Assert.Inconclusive("No instances were found in the database.");
            }
        }