Пример #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
                );
        }
Пример #2
0
 protected override void VisitDocumentFragment(DomDocumentFragment fragment)
 {
     using (manager.CreateSession()) {
         DoChildVisit(fragment, "this.__document");
     }
 }
Пример #3
0
        protected virtual void VisitDocumentFragment(DomDocumentFragment fragment)
        {
            if (fragment == null)
                throw new ArgumentNullException("fragment");

            DefaultVisit(fragment);
        }
Пример #4
0
 void IDomNodeVisitor.Visit(DomDocumentFragment fragment)
 {
     VisitDocumentFragment(fragment);
 }
Пример #5
0
        public void ParentNode_should_be_null()
        {
            var doc = new DomDocumentFragment();

            Assert.Null(doc.ParentElement);
        }
Пример #6
0
        public void NodeValue_is_null()
        {
            var doc = new DomDocumentFragment();

            Assert.Null(doc.NodeValue);
        }
Пример #7
0
        public void NodeName_equals_special_name()
        {
            var doc = new DomDocumentFragment();

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

            Assert.NotNull(frag.OwnerDocument);
        }