示例#1
0
        public void TypeAttribute()
        {
            var rd    = new XmlAttributeReader(new MemoryStream(Encoding.UTF8.GetBytes(Data)));
            var attrs = rd.GetAttributes <TableAttribute>(typeof(XmlReaderTests));

            Assert.NotNull(attrs);
            Assert.AreEqual(1, attrs.Length);
            Assert.AreEqual("TestName", attrs[0].Name);
        }
示例#2
0
        public void FieldAttribute()
        {
            var rd    = new XmlAttributeReader(new MemoryStream(Encoding.UTF8.GetBytes(Data)));
            var attrs = rd.GetAttributes <ColumnAttribute>(InfoOf.Member <XmlReaderTests>(a => a.Field1));

            Assert.NotNull(attrs);
            Assert.AreEqual(1, attrs.Length);
            Assert.AreEqual("TestName", attrs[0].Name);
        }
示例#3
0
        public void PropertyAttribute()
        {
            var rd = new XmlAttributeReader(new MemoryStream(Encoding.UTF8.GetBytes(Data)));

            MappingSchema.Default.AddMetadataReader(rd);

            var attrs = MappingSchema.Default.GetAttributes <MapValueAttribute>(InfoOf.Member <XmlReaderTests>(a => a.Property1));

            Assert.NotNull(attrs);
            Assert.AreEqual(1, attrs.Length);
            Assert.AreEqual("TestName", attrs[0].Value);
        }
示例#4
0
 public void Parse()
 {
     _ = new XmlAttributeReader(new MemoryStream(Encoding.UTF8.GetBytes(_data)));
 }