public void DeletePageTest() { string pageName = "New Page"; var page = pageInterface.Create(pageName, pageTestContext.users[0]); var fetched = pageInterface.GetByName(pageName); Assert.NotNull(fetched); long count = pageInterface.Delete(page.Id); Assert.Equal(1, count); fetched = pageInterface.GetByName(pageName); Assert.Null(fetched); }
public long Delete(string pageId, User subject) { if (!membershipInterface.IsAdmin(pageId, subject)) { throw new NotAuthorized(); } return(pageInterface.Delete(pageId)); }