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)); }
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)); }
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); } }