I have a custom attribute that is used only to indicate a member (no constructor , no properties ):
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] public sealed class MyCustomAttribute : Attribute { }
How could I unit test this? And to clarify ... I know the "what", but not the "how"
I assume there is a unit test way to ensure the correct AttributeUsage in place? So how could I do this? Every time I create a mock class and try to add an attribute to the wrong thing, it will not let me compile, so how can I create a bad mock class for testing?
source share