public void Test_ClassWithCustomAttributeInherited() { TestCustomAttribute attribute = _reflectionCache.GetCustomAttribute <TestCustomAttribute>(typeof(ClassWithCustomAttributeInherited)); TestCustomInheritedAttribute inheritedAttribute = _reflectionCache.GetCustomAttribute <TestCustomInheritedAttribute>(typeof(ClassWithCustomAttributeInherited)); Assert.IsNotNull(attribute); Assert.IsNotNull(inheritedAttribute); }
public void Test_CacheHit() { TestCustomAttribute attribute = _reflectionCache.GetCustomAttribute <TestCustomAttribute>(typeof(ClassWithCustomAttribute)); Assert.IsTrue(_reflectionCache.HasCachedCustomAttribute <TestCustomAttribute>(typeof(ClassWithCustomAttribute))); }
public void Test_ClassWithInterhitedCustomAttribute_InheritedAttribute() { TestCustomAttribute attribute = _reflectionCache.GetCustomAttribute <TestCustomAttribute>(typeof(ClassWithInterhitedCustomAttribute), true); Assert.IsNotNull(attribute); }
public void Test_ClassWithoutCustomAttribute() { TestCustomAttribute attribute = _reflectionCache.GetCustomAttribute <TestCustomAttribute>(typeof(ClassWithoutCustomAttribute)); Assert.IsNull(attribute); }