Beispiel #1
0
        public IHttpActionResult DeleteSubject(int id)
        {
            try
            {
                subjectClient.DeleteSubject(id);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
Beispiel #2
0
        public void DeleteSubject()
        {
            EAV.Store.Clients.ISubjectStoreClient client = factory.Create <EAV.Store.Clients.ISubjectStoreClient>();

            EAVStoreClient.Entity  dbEntity    = SelectRandomItem(this.DbContext.Entities);
            EAVStoreClient.Context dbContext   = SelectRandomItem(this.DbContext.Contexts);
            EAVStoreClient.Subject dbSubjectIn = CreateSubject(dbContext.Context_ID, dbEntity.Entity_ID, Guid.NewGuid().ToString());

            client.DeleteSubject(dbSubjectIn.Subject_ID);

            EAVStoreClient.Subject dbSubjectOut = this.DbContext.Subjects.SingleOrDefault(it => it.Subject_ID == dbSubjectIn.Subject_ID);

            Assert.IsNull(dbSubjectOut, "Failed to delete subject ID {0} from the database.", dbSubjectIn.Subject_ID);
        }