In the past it has been a real PITA to unit test custom Code Analysis rules. I haven't found anything out there that shows the situation to be any different i开发者_StackOverflow中文版n 2010, but I'm not giving up. If anyone knows if this is "possible" in 2010 please respond - thanks!
Johnathan,
I should've posted this sooner...I eventually figured this out in VS2010, and it's actually quite easy:
http://www.jasonbock.net/JB/Default.aspx?blog=entry.d6f6046800d945e6b94e8d92a4da52c2
Sounds like you have to do it the old fashioned way.
- Create a test project that demonstrates all the issues you are supposed to catch.
- Create a test harness that executes MSBuild against your test project and captures the output.
- Parse the results looking for the errors you intended.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论