Methods with NUnit attributes can be ignored

12 views
Skip to first unread message

lextm

unread,
Jul 29, 2008, 9:42:58 PM7/29/08
to Gendarme
Hi, I love to include NUnit test cases inside assemblies. However,
this leads Gendarme to generate warnings on the test cases, too. I am
sure these warnings are real positive, but they are not necessary at
all.

Because all those test cases have NUnit attributes, is there a way to
tell Gendarme to ignore them? I am using the Win32 installer for
Gendarme 0.2

Daniel Abramov

unread,
Jul 30, 2008, 7:50:19 AM7/30/08
to gend...@googlegroups.com
Hi! I would like to second this.
Also I was thinking if there are any special rules designed for NUnit test cases/fixtures possible (e.g. these* can be easily turned into Gendarme rules).

* http://www.mono-project.com/Mono_Contribution_HOWTO#The_NUnit_Tests_Guidelines_document

Sebastien Pouliot

unread,
Aug 5, 2008, 9:28:07 PM8/5/08
to Gendarme
On Jul 29, 9:42 pm, lextm <lextu...@gmail.com> wrote:
> Hi, I love to include NUnit test cases inside assemblies. However,

You even include them in the "release" (versus "debug") builds ?

> this leads Gendarme to generate warnings on the test cases, too. I am
> sure these warnings are real positive, but they are not necessary at
> all.

Yes it must be noisy.

> Because all those test cases have NUnit attributes, is there a way to
> tell Gendarme to ignore them? I am using the Win32 installer for
> Gendarme 0.2

Not automatically - at least not the moment... it's a feature to think
about*

However you can, right now, ignore them if you use the console runner
(also part of the win32 installer). The length of the ignore file
would depend on how the test are spread in your code.

Sebastien

* since we're looking into supporting other "ignore" mechanisms, like
the [SuppressMessage] attribute

Sebastien Pouliot

unread,
Aug 5, 2008, 9:30:39 PM8/5/08
to Gendarme
Hello Dan,

On Jul 30, 7:50 am, "Daniel Abramov" <dan.abra...@gmail.com> wrote:
> Hi! I would like to second this.
> Also I was thinking if there are any special rules designed for NUnit test
> cases/fixtures possible (e.g. these* can be easily turned into Gendarme
> rules).
>
> *http://www.mono-project.com/Mono_Contribution_HOWTO#The_NUnit_Tests_G...

Yes they could - but be aware that this link is VERY old. It talks
about how Mono used NUnit 1.x and it's not how we should do things
anymore.

However you're right that this is something we could have
"specialized" rules for. It's been talked in the past along with
"Rules about rules" and a few other cases.

Sebastien
Reply all
Reply to author
Forward
0 new messages