Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public void Test_CacheHit()
        {
            TestCustomAttribute attribute = _reflectionCache.GetCustomAttribute <TestCustomAttribute>(typeof(ClassWithCustomAttribute));

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

            Assert.IsNotNull(attribute);
        }
Exemplo n.º 4
0
        public void Test_ClassWithoutCustomAttribute()
        {
            TestCustomAttribute attribute = _reflectionCache.GetCustomAttribute <TestCustomAttribute>(typeof(ClassWithoutCustomAttribute));

            Assert.IsNull(attribute);
        }