예제 #1
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);
        }
예제 #2
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);
        }