disable documentation rules for unit tests

Sep 12, 2010 at 10:11 PM
Edited Sep 12, 2010 at 10:22 PM

How can I disable all documentation rules for my nunit tests ? They are in a separate project within the solution. The project name always ends with *.UnitTests.csproj and the filenames with *Test.cs I have a .StyleCop Settings File for the solution and would prefer not have an additional one for the unit test project.

Developer
Sep 15, 2010 at 3:20 AM
Edited Sep 15, 2010 at 3:21 AM

Right click the project in solution explorer, select StyleCop Settings.  Adjust the checkboxes to suit your needs; documentation settings are at the top.  These settings are heirarchal, so they only apply to the test project you set this for.  You will probably need to do this manually, once, for each test project.  You can check in the StyleCop settings file to source control so others using the code/tests will also be using the appropriate settings automatically.

Sep 15, 2010 at 6:59 AM

I have a .StyleCop Settings File for the solution and would prefer not have an additional one for the unit test project. Is there a way to do this?

I tried to use wildcards in the SourceFileList node in the settings file. But that didn't work:

<SourceFileList>
    <SourceFile>*Test.cs</SourceFile>
    <Settings>
        <!-- settings here -->
    </Settings>
</SourceFileList>

Sep 15, 2010 at 5:24 PM

No.

The only way to do it is via the solution you already know: seperate Settings.StyleCop files for the NUnit projects.  There is no other way to do it.

Feel free to keep looking for another solution besides the one you've already got though, let us know if you find something.