Example #1
0
        public void TestDeleteDraftItem()
        {
            ItemSetUp();

            With.Transaction(delegate
            {
                DomainRepository <T> .Delete(DraftItem);
            });
            Assert.IsNull(DomainRepository <T> .GetGlobal(DraftItem.ObjectId));
            Assert.IsNull(DomainRepository <T> .GetDraft(DraftItem.ObjectId));
        }
Example #2
0
        public void TestGetDraftItem()
        {
            ItemSetUp();

            Assert.IsNotNull(DomainRepository <T> .GetDraft(DraftItem.ObjectId));

            Assert.IsNull(DomainRepository <T> .GetDraft(ActiveItem.ObjectId));
            Assert.IsNull(DomainRepository <T> .GetDraft(ActiveDeletedItem.ObjectId));
            Assert.IsNull(DomainRepository <T> .GetDraft(ArchivedDeletedItem.ObjectId));
            Assert.IsNull(DomainRepository <T> .GetDraft(DraftDeletedItem.ObjectId));
            Assert.IsNull(DomainRepository <T> .GetDraft(ArchivedItem.ObjectId));
        }
Example #3
0
        public virtual T GetDraft(int id)
        {
            try
            {
                Authorize(Can_Read);
                return(DomainRepository <T> .GetDraft(id));
            }
            catch (System.Exception ex)
            {
                bool reThrow = ExceptionHandler.HandleBusinessLogicLayerException(ex);

                if (reThrow)
                {
                    throw;
                }

                return(null);
            }
        }