Example #1
0
        public void CreateAttribute_uses_primitive_value_specified_by_schema()
        {
            var schema  = new DomSchema("custom");
            var attrDef = schema.AttributeDefinitions.AddNew("lcid");

            attrDef.ValueType = typeof(int);

            var doc = new DomDocumentFragment().WithSchema(schema);

            Assert.IsInstanceOf <DomValue <int> >(
                doc.CreateAttribute("lcid").DomValue
                );
        }
Example #2
0
 protected override void VisitDocumentFragment(DomDocumentFragment fragment)
 {
     using (manager.CreateSession()) {
         DoChildVisit(fragment, "this.__document");
     }
 }
Example #3
0
        protected virtual void VisitDocumentFragment(DomDocumentFragment fragment)
        {
            if (fragment == null)
                throw new ArgumentNullException("fragment");

            DefaultVisit(fragment);
        }
Example #4
0
 void IDomNodeVisitor.Visit(DomDocumentFragment fragment)
 {
     VisitDocumentFragment(fragment);
 }
Example #5
0
        public void ParentNode_should_be_null()
        {
            var doc = new DomDocumentFragment();

            Assert.Null(doc.ParentElement);
        }
Example #6
0
        public void NodeValue_is_null()
        {
            var doc = new DomDocumentFragment();

            Assert.Null(doc.NodeValue);
        }
Example #7
0
        public void NodeName_equals_special_name()
        {
            var doc = new DomDocumentFragment();

            Assert.Equal("#document-fragment", doc.NodeName);
        }
Example #8
0
        public void Constructor_can_create_document_fragment_with_implicit_internal_document()
        {
            var frag = new DomDocumentFragment();

            Assert.NotNull(frag.OwnerDocument);
        }