public void DeleteAttachmentTest() { string attName = "New Attachment"; var att = attachmentInterface.Create(attName, attTestContext.pages[0], attTestContext.users[0]); var fetched = attachmentInterface.GetByName(attName); Assert.NotNull(fetched); long count = attachmentInterface.Delete(att.Id); Assert.Equal(1, count); fetched = attachmentInterface.GetByName(attName); Assert.Null(fetched); }
public long Delete(string attachmentId, User subject) { if (!attachmentInterface.IsAdmin(attachmentId, subject)) { throw new NotAuthorized(); } return(attachmentInterface.Delete(attachmentId)); }