The Switch statement can be optimized in many different ways (small switch/case statements result in if/else, large statements are converted to a HashSet). So it will not be possible to check this from the compiled code. Instead you should use a StyleCop
rule. They have a dedicated forum for these kinds of questions.