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."); }
public IHttpActionResult RetrieveInstance(int id) { try { return(Ok <EAV.Store.IStoreInstance>(instanceClient.RetrieveInstance(id))); } catch (Exception ex) { return(InternalServerError(ex)); } }
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."); } }