public void TestGetActiveItemAfterUnDelete() { ItemSetUp(); With.Transaction(delegate { DomainRepository <T> .UnDelete(ActiveDeletedItem); }); Assert.IsNotNull(DomainRepository <T> .GetActive(ActiveDeletedItem.ObjectId)); Assert.IsNotNull(DomainRepository <T> .Get(ActiveDeletedItem.ObjectId)); }
public void TestGetActiveItem() { ItemSetUp(); Assert.IsNotNull(DomainRepository <T> .GetActive(ActiveItem.ObjectId)); Assert.IsNull(DomainRepository <T> .GetActive(ArchivedItem.ObjectId)); Assert.IsNull(DomainRepository <T> .GetActive(ActiveDeletedItem.ObjectId)); Assert.IsNull(DomainRepository <T> .GetActive(ArchivedDeletedItem.ObjectId)); Assert.IsNull(DomainRepository <T> .GetActive(DraftDeletedItem.ObjectId)); Assert.IsNull(DomainRepository <T> .GetActive(DraftItem.ObjectId)); }
public virtual T GetActive(int id) { try { Authorize(Can_Read); return(DomainRepository <T> .GetActive(id)); } catch (System.Exception ex) { bool reThrow = ExceptionHandler.HandleBusinessLogicLayerException(ex); if (reThrow) { throw; } return(null); } }