Пример #1
0
        public void FieldAttribute()
        {
            var rd    = new AttributeReader();
            var attrs = rd.GetAttributes <MapValueAttribute>(InfoOf.Member <AttributeReaderTests>(a => a.Field1));

            Assert.AreEqual(0, attrs.Length);
        }
Пример #2
0
        public void PropertyAttribute()
        {
            var rd    = new AttributeReader();
            var attrs = rd.GetAttributes <MapValueAttribute>(InfoOf.Member <AttributeReaderTests>(a => a.Property1));

            Assert.NotNull(attrs);
            Assert.AreEqual(1, attrs.Length);
            Assert.AreEqual("TestName", attrs[0].Value);
        }
Пример #3
0
        public void TypeAttribute()
        {
            var rd    = new AttributeReader();
            var attrs = rd.GetAttributes <TestFixtureAttribute>(typeof(AttributeReaderTests));

            Assert.NotNull(attrs);
            Assert.AreEqual(1, attrs.Length);
            Assert.AreEqual(null, attrs[0].Description);
        }