How to disable the "Unused Method" warning for unit tests

3 posts, 0 answers
  1. Calvin
    Calvin avatar
    42 posts
    Member since:
    Jul 2011

    Posted 02 Apr 2012 Link to this post


    JustCode lists warnings for all of my xUnit test methods (annotated with xUnit's [Fact] attribute) indicating that each method is an "unused method". But since these are test methods, they won't get used elsewhere.  Consequently, I regard these JC warnings as a false positives.

    Is there a way to globally disable these warnings (but only for the test methods)?


  2. Yanaki Yanakiev
    Yanaki Yanakiev avatar
    16 posts

    Posted 04 Apr 2012 Link to this post

    Hello Calvin,

    You can't disable the warning only for the test methods. You can hide all warnings for "Unused private members" by setting the option to "Do not show" in JustCode -> Options -> Code analysis -> Warnings -> C#.
    We will work on improving JustCode analysis in such cases and I added a  PITS item where you can monitor our progress. I added some telerik points to your account for the heads up on this issue.

    All the best,
    Yanaki Yanakiev
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
  4. Kevin Babcock
    Kevin Babcock avatar
    189 posts
    Member since:
    Mar 2007

    Posted 18 Jun 2012 Link to this post

    It would be nice to add some kind of "SuppressMessage" attribute we can add to a global class to prevent JustCode displaying warnings/errors for specific code.

    I added my comment to the PITS item.
Back to Top