1
<!-- saved from url=(0014)about:internet --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
3
<!-- Standard Head Part -->
5
<title>NUnit - Ignore</title>
6
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
7
<meta http-equiv="Content-Language" content="en-US">
8
<meta name="norton-safeweb-site-verification" content="tb6xj01p4hgo5x-8wscsmq633y11-e6nhk-bnb5d987bseanyp6p0uew-pec8j963qlzj32k5x9h3r2q7wh-vmy8bbhek5lnpp5w4p8hocouuq39e09jrkihdtaeknua" />
9
<link rel="stylesheet" type="text/css" href="nunit.css">
10
<link rel="shortcut icon" href="favicon.ico">
12
<!-- End Standard Head Part -->
16
<!-- Standard Header for NUnit.org -->
18
<a id="logo" href="http://www.nunit.org"><img src="img/logo.gif" alt="NUnit.org" title="NUnit.org"></a>
1
<!-- saved from url=(0014)about:internet --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
3
<!-- Standard Head Part -->
5
<title>NUnit - Ignore</title>
6
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
7
<meta http-equiv="Content-Language" content="en-US">
8
<meta name="norton-safeweb-site-verification" content="tb6xj01p4hgo5x-8wscsmq633y11-e6nhk-bnb5d987bseanyp6p0uew-pec8j963qlzj32k5x9h3r2q7wh-vmy8bbhek5lnpp5w4p8hocouuq39e09jrkihdtaeknua" />
9
<link rel="stylesheet" type="text/css" href="nunit.css">
10
<link rel="shortcut icon" href="favicon.ico">
12
<!-- End Standard Head Part -->
16
<!-- Standard Header for NUnit.org -->
18
<a id="logo" href="http://www.nunit.org"><img src="img/logo.gif" alt="NUnit.org" title="NUnit.org"></a>
20
20
<a href="http://www.nunit.org">NUnit</a>
21
21
<a class="active" href="index.html">Documentation</a>
24
<!-- End of Header -->
28
<script language="JavaScript" src="codeFuncs.js" ></script> <!-- Do it this way for IE -->
30
<h3>IgnoreAttribute (NUnit 2.0)</h3>
32
<p>The ignore attribute is an attribute to not run a test or test fixture for a
33
period of time. The person marks either a Test or a TestFixture with the Ignore
34
Attribute. The running program sees the attribute and does not run the test or
35
tests. The progress bar will turn yellow if a test is not run and the test will
36
be mentioned in the reports that it was not run.</p>
38
<p>This feature should be used to temporarily not run a test or fixture. This is a
39
better mechanism than commenting out the test or renaming methods, since the
40
tests will be compiled with the rest of the code and there is an indication at
41
run time that a test is not being run. This insures that tests will not be
44
<h4>Test Fixture Syntax</h4>
48
<div class="langFilter">
49
<a href="javascript:Show('DD1')" onmouseover="Show('DD1')"><img src="img/langFilter.gif" width="14" height="14" alt="Language Filter"></a>
50
<div id="DD1" class="dropdown" style="display: none;" onclick="Hide('DD1')">
51
<a href="javascript:ShowCS()">C#</a><br>
52
<a href="javascript:ShowVB()">VB</a><br>
53
<a href="javascript:ShowMC()">C++</a><br>
54
<a href="javascript:ShowJS()">J#</a><br>
58
<pre class="cs">namespace NUnit.Tests
61
using NUnit.Framework;
64
[Ignore("Ignore a fixture")]
65
public class SuccessTests
72
<pre class="vb">Imports System
73
Imports Nunit.Framework
77
<TestFixture(), Ignore("Ignore a fixture")>
78
Public Class SuccessTests
84
<pre class="mc">#using <Nunit.Framework.dll>
85
using namespace System;
86
using namespace NUnit::Framework;
91
[Ignore("Ignore a fixture")]
92
public __gc class SuccessTests
98
#include "cppsample.h"
100
namespace NUnitTests {
105
<pre class="js">package NUnit.Tests;
108
import NUnit.Framework.TestFixture;
111
/** @attribute NUnit.Framework.TestFixture() */
112
/** @attribute NUnit.Framework.Ignore("Ignore a fixture") */
113
public class SuccessTests
125
<div class="langFilter">
126
<a href="javascript:Show('DD2')" onmouseover="Show('DD2')"><img src="img/langFilter.gif" width="14" height="14" alt="Language Filter"></a>
127
<div id="DD2" class="dropdown" style="display: none;" onclick="Hide('DD2')">
128
<a href="javascript:ShowCS()">C#</a><br>
129
<a href="javascript:ShowVB()">VB</a><br>
130
<a href="javascript:ShowMC()">C++</a><br>
131
<a href="javascript:ShowJS()">J#</a><br>
135
<pre class="cs">namespace NUnit.Tests
138
using NUnit.Framework;
141
public class SuccessTests
144
[Ignore("Ignore a test")]
145
public void IgnoredTest()
150
<pre class="vb">Imports System
151
Imports Nunit.Framework
153
Namespace Nunit.Tests
155
<TestFixture()>
156
Public Class SuccessTests
157
<Test(), Ignore("Ignore a test")> Public Sub Ignored()
164
<pre class="mc">#using <Nunit.Framework.dll>
165
using namespace System;
166
using namespace NUnit::Framework;
171
public __gc class SuccessTests
173
[Test][Ignore("Ignore a test")] void IgnoredTest();
177
#include "cppsample.h"
179
namespace NUnitTests {
184
<pre class="js">package NUnit.Tests;
187
import NUnit.Framework.TestFixture;
190
/** @attribute NUnit.Framework.TestFixture() */
191
public class SuccessTests
193
/** @attribute NUnit.Framework.Test() */
194
/** @attribute NUnit.Framework.Ignore("ignored test") */
195
public void IgnoredTest()
207
<li><a href="index.html">NUnit 2.6</a></li>
209
<li><a href="getStarted.html">Getting Started</a></li>
210
<li><a href="writingTests.html">Writing Tests</a></li>
212
<li><a href="assertions.html">Assertions</a></li>
213
<li><a href="attributes.html">Attributes</a></li>
215
<li><a href="actionAttributes.html">Action Attributes</a></li>
216
<li><a href="category.html">Category</a></li>
217
<li><a href="combinatorial.html">Combinatorial</a></li>
218
<li><a href="culture.html">Culture</a></li>
219
<li><a href="datapoint.html">Datapoint(s)</a></li>
220
<li><a href="description.html">Description</a></li>
221
<li><a href="exception.html">Exception</a></li>
222
<li><a href="explicit.html">Explicit</a></li>
223
<li id="current"><a href="ignore.html">Ignore</a></li>
224
<li><a href="maxtime.html">Maxtime</a></li>
225
<li><a href="pairwise.html">Pairwise</a></li>
226
<li><a href="platform.html">Platform</a></li>
227
<li><a href="property.html">Property</a></li>
228
<li><a href="random.html">Random</a></li>
229
<li><a href="range.html">Range</a></li>
230
<li><a href="repeat.html">Repeat</a></li>
231
<li><a href="requiredAddin.html">RequiredAddin</a></li>
232
<li><a href="requiresMTA.html">Requires MTA</a></li>
233
<li><a href="requiresSTA.html">Requires STA</a></li>
234
<li><a href="requiresThread.html">Requires Thread</a></li>
235
<li><a href="sequential.html">Sequential</a></li>
236
<li><a href="setCulture.html">SetCulture</a></li>
237
<li><a href="setUICulture.html">SetUICulture</a></li>
238
<li><a href="setup.html">Setup</a></li>
239
<li><a href="setupFixture.html">SetupFixture</a></li>
240
<li><a href="suite.html">Suite</a></li>
241
<li><a href="teardown.html">Teardown</a></li>
242
<li><a href="test.html">Test</a></li>
243
<li><a href="testCase.html">TestCase</a></li>
244
<li><a href="testCaseSource.html">TestCaseSource</a></li>
245
<li><a href="testFixture.html">TestFixture</a></li>
246
<li><a href="fixtureSetup.html">TestFixtureSetUp</a></li>
247
<li><a href="fixtureTeardown.html">TestFixtureTearDown</a></li>
248
<li><a href="theory.html">Theory</a></li>
249
<li><a href="timeout.html">Timeout</a></li>
250
<li><a href="values.html">Values</a></li>
251
<li><a href="valueSource.html">ValueSource</a></li>
253
<li><a href="constraintModel.html">Constraints</a></li>
254
<li><a href="testContext.html">Test Context</a></li>
256
<li><a href="runningTests.html">Running Tests</a></li>
257
<li><a href="extensibility.html">Extensibility</a></li>
258
<li><a href="releaseNotes.html">Release Notes</a></li>
259
<li><a href="samples.html">Samples</a></li>
260
<li><a href="license.html">License</a></li>
262
<li><a href="vsTestAdapter.html">NUnit Test Adapter 0.90</a></li>
264
<li><a href="vsTestAdapterLicense.html">License</a></li>
266
<li><a href="&r=2.6.html"></a></li>
267
<li><a href="&r=2.6.html"></a></li>
270
<!-- End of Submenu -->
273
<!-- Standard Footer for NUnit.org -->
275
Copyright © 2012 Charlie Poole. All Rights Reserved.
277
<!-- End of Footer -->
24
<!-- End of Header -->
28
<script language="JavaScript" src="codeFuncs.js" ></script> <!-- Do it this way for IE -->
30
<h3>IgnoreAttribute (NUnit 2.0)</h3>
32
<p>The ignore attribute is an attribute to not run a test or test fixture for a
33
period of time. The person marks either a Test or a TestFixture with the Ignore
34
Attribute. The running program sees the attribute and does not run the test or
35
tests. The progress bar will turn yellow if a test is not run and the test will
36
be mentioned in the reports that it was not run.</p>
38
<p>This feature should be used to temporarily not run a test or fixture. This is a
39
better mechanism than commenting out the test or renaming methods, since the
40
tests will be compiled with the rest of the code and there is an indication at
41
run time that a test is not being run. This insures that tests will not be
44
<h4>Test Fixture Syntax</h4>
48
<div class="langFilter">
49
<a href="javascript:Show('DD1')" onmouseover="Show('DD1')"><img src="img/langFilter.gif" width="14" height="14" alt="Language Filter"></a>
50
<div id="DD1" class="dropdown" style="display: none;" onclick="Hide('DD1')">
51
<a href="javascript:ShowCS()">C#</a><br>
52
<a href="javascript:ShowVB()">VB</a><br>
53
<a href="javascript:ShowMC()">C++</a><br>
54
<a href="javascript:ShowJS()">J#</a><br>
58
<pre class="cs">namespace NUnit.Tests
61
using NUnit.Framework;
64
[Ignore("Ignore a fixture")]
65
public class SuccessTests
72
<pre class="vb">Imports System
73
Imports Nunit.Framework
77
<TestFixture(), Ignore("Ignore a fixture")>
78
Public Class SuccessTests
84
<pre class="mc">#using <Nunit.Framework.dll>
85
using namespace System;
86
using namespace NUnit::Framework;
91
[Ignore("Ignore a fixture")]
92
public __gc class SuccessTests
98
#include "cppsample.h"
100
namespace NUnitTests {
105
<pre class="js">package NUnit.Tests;
108
import NUnit.Framework.TestFixture;
111
/** @attribute NUnit.Framework.TestFixture() */
112
/** @attribute NUnit.Framework.Ignore("Ignore a fixture") */
113
public class SuccessTests
125
<div class="langFilter">
126
<a href="javascript:Show('DD2')" onmouseover="Show('DD2')"><img src="img/langFilter.gif" width="14" height="14" alt="Language Filter"></a>
127
<div id="DD2" class="dropdown" style="display: none;" onclick="Hide('DD2')">
128
<a href="javascript:ShowCS()">C#</a><br>
129
<a href="javascript:ShowVB()">VB</a><br>
130
<a href="javascript:ShowMC()">C++</a><br>
131
<a href="javascript:ShowJS()">J#</a><br>
135
<pre class="cs">namespace NUnit.Tests
138
using NUnit.Framework;
141
public class SuccessTests
144
[Ignore("Ignore a test")]
145
public void IgnoredTest()
150
<pre class="vb">Imports System
151
Imports Nunit.Framework
153
Namespace Nunit.Tests
155
<TestFixture()>
156
Public Class SuccessTests
157
<Test(), Ignore("Ignore a test")> Public Sub Ignored()
164
<pre class="mc">#using <Nunit.Framework.dll>
165
using namespace System;
166
using namespace NUnit::Framework;
171
public __gc class SuccessTests
173
[Test][Ignore("Ignore a test")] void IgnoredTest();
177
#include "cppsample.h"
179
namespace NUnitTests {
184
<pre class="js">package NUnit.Tests;
187
import NUnit.Framework.TestFixture;
190
/** @attribute NUnit.Framework.TestFixture() */
191
public class SuccessTests
193
/** @attribute NUnit.Framework.Test() */
194
/** @attribute NUnit.Framework.Ignore("ignored test") */
195
public void IgnoredTest()
207
<li><a href="index.html">NUnit 2.6.3</a></li>
209
<li><a href="getStarted.html">Getting Started</a></li>
210
<li><a href="writingTests.html">Writing Tests</a></li>
212
<li><a href="assertions.html">Assertions</a></li>
213
<li><a href="attributes.html">Attributes</a></li>
215
<li><a href="actionAttributes.html">Action Attributes</a></li>
216
<li><a href="category.html">Category</a></li>
217
<li><a href="combinatorial.html">Combinatorial</a></li>
218
<li><a href="culture.html">Culture</a></li>
219
<li><a href="datapoint.html">Datapoint(s)</a></li>
220
<li><a href="description.html">Description</a></li>
221
<li><a href="exception.html">Exception</a></li>
222
<li><a href="explicit.html">Explicit</a></li>
223
<li id="current"><a href="ignore.html">Ignore</a></li>
224
<li><a href="maxtime.html">Maxtime</a></li>
225
<li><a href="pairwise.html">Pairwise</a></li>
226
<li><a href="platform.html">Platform</a></li>
227
<li><a href="property.html">Property</a></li>
228
<li><a href="random.html">Random</a></li>
229
<li><a href="range.html">Range</a></li>
230
<li><a href="repeat.html">Repeat</a></li>
231
<li><a href="requiredAddin.html">RequiredAddin</a></li>
232
<li><a href="requiresMTA.html">Requires MTA</a></li>
233
<li><a href="requiresSTA.html">Requires STA</a></li>
234
<li><a href="requiresThread.html">Requires Thread</a></li>
235
<li><a href="sequential.html">Sequential</a></li>
236
<li><a href="setCulture.html">SetCulture</a></li>
237
<li><a href="setUICulture.html">SetUICulture</a></li>
238
<li><a href="setup.html">Setup</a></li>
239
<li><a href="setupFixture.html">SetupFixture</a></li>
240
<li><a href="suite.html">Suite</a></li>
241
<li><a href="teardown.html">Teardown</a></li>
242
<li><a href="test.html">Test</a></li>
243
<li><a href="testCase.html">TestCase</a></li>
244
<li><a href="testCaseSource.html">TestCaseSource</a></li>
245
<li><a href="testFixture.html">TestFixture</a></li>
246
<li><a href="fixtureSetup.html">TestFixtureSetUp</a></li>
247
<li><a href="fixtureTeardown.html">TestFixtureTearDown</a></li>
248
<li><a href="theory.html">Theory</a></li>
249
<li><a href="timeout.html">Timeout</a></li>
250
<li><a href="values.html">Values</a></li>
251
<li><a href="valueSource.html">ValueSource</a></li>
253
<li><a href="testContext.html">Test Context</a></li>
255
<li><a href="runningTests.html">Running Tests</a></li>
256
<li><a href="extensibility.html">Extensibility</a></li>
257
<li><a href="releaseNotes.html">Release Notes</a></li>
258
<li><a href="samples.html">Samples</a></li>
259
<li><a href="license.html">License</a></li>
261
<li><a href="vsTestAdapter.html">NUnit Test Adapter</a></li>
263
<li><a href="vsTestAdapterLicense.html">License</a></li>
264
<li><a href="vsTestAdapterReleaseNotes.html">Release Notes</a></li>
266
<li><a href="&r=2.6.3.html"></a></li>
267
<li><a href="&r=2.6.3.html"></a></li>
270
<!-- End of Submenu -->
273
<!-- Standard Footer for NUnit.org -->
275
Copyright © 2012 Charlie Poole. All Rights Reserved.
277
<!-- End of Footer -->