Ejemplo n.º 1
0
        private string AttributeParsingHelper(Type type)
        {
            ContentTypeManagerAccessor   ctmAcc = new ContentTypeManagerAccessor(ContentTypeManager.Current);
            NodeTypeRegistrationAccessor ntrAcc = ctmAcc.ParseAttributes(type);

            return(ntrAcc.ToString());
        }
Ejemplo n.º 2
0
        public void Attr_ContentHandlerMustHaveAttribute()
        {
            Type type = typeof(SenseNet.ContentRepository.Tests.ContentHandlers.BadHandler2);
            ContentTypeManagerAccessor   ctmAcc = new ContentTypeManagerAccessor(ContentTypeManager.Current);
            NodeTypeRegistrationAccessor ntrAcc = ctmAcc.ParseAttributes(type);

            Assert.IsNull(ntrAcc);
        }
Ejemplo n.º 3
0
        public void Attr_ContentHandlerMustBeANode()
        {
            Type type = typeof(SenseNet.ContentRepository.Tests.ContentHandlers.BadHandler1);
            ContentTypeManagerAccessor ctmAcc = new ContentTypeManagerAccessor(ContentTypeManager.Current);

            try
            {
                NodeTypeRegistrationAccessor ntrAcc = ctmAcc.ParseAttributes(type);
            }
            catch (Exception e)
            {
                Exception ee = e.InnerException;
                Assert.IsTrue(ee is ContentRegistrationException);
            }
        }