Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between the Explicit and Ignore attributes in nunit

Tags:

What is the difference between the ExplicitAttribute and the IgnoreAttribute in nunit?

like image 982
Simon Avatar asked Feb 23 '11 01:02

Simon


People also ask

What is NUnit explicit?

The Explicit attribute causes a test or test fixture to be ignored unless it is explicitly selected for running. The test or fixture will be run if it is selected in the gui, if its name is specified on the console runner command line as the fixture to run or if it is included by use of a Category filter.

How do I ignore a NUnit test?

IgnoreAttribute (NUnit 2.0) The ignore attribute is an attribute to not run a test or test fixture for a period of time. The person marks either a Test or a TestFixture with the Ignore Attribute. The running program sees the attribute and does not run the test or tests.

Which attribute is used to run the test after each test method in NUnit?

Combinatorial Attribute The CombinatorialAttribute is used on a test to specify that NUnit should generate test cases for all possible combinations of the individual data items provided for the parameters of a test.


1 Answers

If you are asking for Use cases: When should i use [Explicit] and when [Ignore]:

I use [Explicit]

  • for long running tests that should not run every time. This guarantees fast execution of the testsuite.

I use [Ignore]

  • for broken tests that i am currently fixing and
  • as a kind of todo-list for tests that are not implemented yet
like image 82
k3b Avatar answered Dec 08 '22 01:12

k3b