I'm trying to write a convention test that specifies that a method should only be called in some contexts - specifically I have a static Empty
getter that I only want to allow used in test methods, vis methods decorated with TestAttribute
.
I know that I should also mark the getter as obsolete, use another method etc, but I also want a convention test around this so it doesn't break in the future.
I am guessing I want to use static analysis through reflection in my convention test. How would I go about performing this kind of analysis?