예제 #1
0
        public void Test_ClassWithCustomAttributeInherited()
        {
            TestCustomAttribute          attribute          = _reflectionCache.GetCustomAttribute <TestCustomAttribute>(typeof(ClassWithCustomAttributeInherited));
            TestCustomInheritedAttribute inheritedAttribute = _reflectionCache.GetCustomAttribute <TestCustomInheritedAttribute>(typeof(ClassWithCustomAttributeInherited));

            Assert.IsNotNull(attribute);
            Assert.IsNotNull(inheritedAttribute);
        }
예제 #2
0
        public void Test_CacheHit()
        {
            TestCustomAttribute attribute = _reflectionCache.GetCustomAttribute <TestCustomAttribute>(typeof(ClassWithCustomAttribute));

            Assert.IsTrue(_reflectionCache.HasCachedCustomAttribute <TestCustomAttribute>(typeof(ClassWithCustomAttribute)));
        }
예제 #3
0
        public void Test_ClassWithInterhitedCustomAttribute_InheritedAttribute()
        {
            TestCustomAttribute attribute = _reflectionCache.GetCustomAttribute <TestCustomAttribute>(typeof(ClassWithInterhitedCustomAttribute), true);

            Assert.IsNotNull(attribute);
        }
예제 #4
0
        public void Test_ClassWithoutCustomAttribute()
        {
            TestCustomAttribute attribute = _reflectionCache.GetCustomAttribute <TestCustomAttribute>(typeof(ClassWithoutCustomAttribute));

            Assert.IsNull(attribute);
        }