Ejemplo n.º 1
0
        public void CreateAttachmentTest()
        {
            string attName = "New Attachment";
            var    att     = attachmentInterface.Create(attName, attTestContext.pages[0], attTestContext.users[0]);

            var fetched = attachmentInterface.GetByName(attName);

            Assert.NotNull(fetched);

            Assert.Equal(att.Id, fetched.Id);

            Assert.Equal(attName, fetched.Name);
            Assert.Equal(fetched.Acl.ownerId, attTestContext.users[0].Id);
            Assert.Equal(fetched.ParentId, attTestContext.pages[0].Id);
        }
Ejemplo n.º 2
0
        public Attachment AddAttachment(string name, string pageId, User subject)
        {
            if (!membershipInterface.IsAdmin(pageId, subject))
            {
                throw new NotAuthorized();
            }

            return(attachmentInterface.Create(name, pageInterface.GetById(pageId), subject));
        }