public void RetrieveNonExistentSubject() { EAV.Store.Clients.ISubjectStoreClient client = factory.Create <EAV.Store.Clients.ISubjectStoreClient>(); var subject = client.RetrieveSubject(-1); Assert.IsNull(subject, "Unexpected subject object retrieved."); }
public IHttpActionResult RetrieveSubject(int id) { try { return(Ok <EAV.Store.IStoreSubject>(subjectClient.RetrieveSubject(id))); } catch (Exception ex) { return(InternalServerError(ex)); } }
public void RetrieveRandomSubject() { var dbSubject = SelectRandomItem(this.DbContext.Subjects); if (dbSubject != null) { EAV.Store.Clients.ISubjectStoreClient client = factory.Create <EAV.Store.Clients.ISubjectStoreClient>(); var subject = client.RetrieveSubject(dbSubject.Subject_ID); Assert.IsNotNull(subject, "Failed to retrieve subject {0}.", dbSubject.Subject_ID); Assert.AreEqual(dbSubject.Subject_ID, subject.SubjectID, "Subject ID values do not match."); } else { Assert.Inconclusive("No subjects were found in the database."); } }