public static void SetQuirksMode(this DomDocument self, QuirksMode value) { self.RemoveAnnotations <QuirksModeAnnotation>(); if (value != QuirksMode.None) { self.AddAnnotation(new QuirksModeAnnotation(value)); } }
public void test_add_annotation_nominal() { DomDocument d = new DomDocument(); d.AddAnnotation(DBNull.Value); Assert.True(d.HasAnnotation<DBNull>()); Assert.That(d.Annotations<DBNull>(), Is.Not.Empty); Assert.That(d.Annotations<Uri>(), Is.Empty); Assert.That(d.Annotation<DBNull>(), Is.EqualTo(DBNull.Value)); }
public void AddAnnotation_nominal() { DomDocument d = new DomDocument(); d.AddAnnotation(AnnotationClass.Value); Assert.True(d.HasAnnotation <AnnotationClass>()); Assert.NotEmpty(d.Annotations <AnnotationClass>()); Assert.Empty(d.Annotations <Uri>()); Assert.Equal(AnnotationClass.Value, d.Annotation <AnnotationClass>()); }