public void GetAttributes_Property()
        {
            PropertyInfo property = typeof(ReflectionTestObject).GetProperty("TestProperty");

            ReflectionAttributeProvider provider = new ReflectionAttributeProvider(property);

            IList<Attribute> attributes = provider.GetAttributes(typeof(DefaultValueAttribute), false);
            Assert.AreEqual(1, attributes.Count);

            attributes = provider.GetAttributes(false);
            Assert.AreEqual(2, attributes.Count);
        }
        public void GetAttributes_Property()
        {
            PropertyInfo property;
#if DNXCORE50
            property = Newtonsoft.Json.Utilities.TypeExtensions.GetProperty(typeof(ReflectionTestObject), "TestProperty");
#else
            property = typeof(ReflectionTestObject).GetProperty("TestProperty");
#endif

            ReflectionAttributeProvider provider = new ReflectionAttributeProvider(property);

            IList<Attribute> attributes = provider.GetAttributes(typeof(DefaultValueAttribute), false);
            Assert.AreEqual(1, attributes.Count);

            attributes = provider.GetAttributes(false);
            Assert.AreEqual(2, attributes.Count);
        }
        public void GetAttributes_Field()
        {
            FieldInfo field = (FieldInfo)typeof(ReflectionTestObject).GetField("TestField");

            ReflectionAttributeProvider provider = new ReflectionAttributeProvider(field);

            IList<Attribute> attributes = provider.GetAttributes(typeof(DefaultValueAttribute), false);
            Assert.AreEqual(1, attributes.Count);

            attributes = provider.GetAttributes(false);
            Assert.AreEqual(2, attributes.Count);
        }
        public void GetAttributes_Parameter()
        {
            ParameterInfo[] parameters = typeof(ReflectionTestObject).GetConstructor(new[] { typeof(int) }).GetParameters();

            ParameterInfo parameter = parameters[0];

            ReflectionAttributeProvider provider = new ReflectionAttributeProvider(parameter);

            IList<Attribute> attributes = provider.GetAttributes(typeof(DefaultValueAttribute), false);
            Assert.AreEqual(1, attributes.Count);

            attributes = provider.GetAttributes(false);
            Assert.AreEqual(2, attributes.Count);
        }
        public void GetAttributes_Field()
        {
            FieldInfo field;
#if DNXCORE50
            field = (FieldInfo)Newtonsoft.Json.Utilities.TypeExtensions.GetField(typeof(ReflectionTestObject), "TestField");
#else
            field = typeof(ReflectionTestObject).GetField("TestField");
#endif

            ReflectionAttributeProvider provider = new ReflectionAttributeProvider(field);

            IList<Attribute> attributes = provider.GetAttributes(typeof(DefaultValueAttribute), false);
            Assert.AreEqual(1, attributes.Count);

            attributes = provider.GetAttributes(false);
            Assert.AreEqual(2, attributes.Count);
        }