예제 #1
0
        public void CreateMetadataPropertyFromXmlAttribute_creates_annotation_with_string_if_no_serializer_available()
        {
            var property = new SomeElement().CreateMetadataPropertyFromXmlAttribute(
                XmlConstants.CustomAnnotationNamespace, "UseClrTypes", "true");

            Assert.Equal(XmlConstants.UseClrTypesAnnotation, property.Name);
            Assert.Equal("true", property.Value);
        }
예제 #2
0
        public void CreateMetadataPropertyFromXmlAttribute_creates_annotation_using_serializer_if_available()
        {
            var property = new SomeElement().CreateMetadataPropertyFromXmlAttribute(
                XmlConstants.CustomAnnotationNamespace, "ClrType", typeof(Random).AssemblyQualifiedName);

            Assert.Equal(XmlConstants.ClrTypeAnnotation, property.Name);
            Assert.Same(typeof(Random), property.Value);
        }