[1146] | 1 | <!-- saved from url=(0014)about:internet --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
---|
| 2 | <html>
|
---|
| 3 | <!-- Standard Head Part -->
|
---|
| 4 | <head>
|
---|
| 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 | <link rel="stylesheet" type="text/css" href="nunit.css">
|
---|
| 9 | <link rel="shortcut icon" href="favicon.ico">
|
---|
| 10 | </head>
|
---|
| 11 | <!-- End Standard Head Part -->
|
---|
| 12 |
|
---|
| 13 | <body>
|
---|
| 14 |
|
---|
| 15 | <!-- Standard Header for NUnit.org -->
|
---|
| 16 | <div id="header">
|
---|
| 17 | <a id="logo" href="http://www.nunit.org"><img src="img/logo.gif" alt="NUnit.org" title="NUnit.org"></a>
|
---|
| 18 | <div id="nav">
|
---|
| 19 | <a href="http://www.nunit.org">NUnit</a>
|
---|
| 20 | <a class="active" href="index.html">Documentation</a>
|
---|
| 21 | </div>
|
---|
| 22 | </div>
|
---|
| 23 | <!-- End of Header -->
|
---|
| 24 |
|
---|
| 25 | <div id="content">
|
---|
| 26 |
|
---|
| 27 | <script language="JavaScript" src="codeFuncs.js" ></script> <!-- Do it this way for IE -->
|
---|
| 28 |
|
---|
| 29 | <h3>IgnoreAttribute (NUnit 2.0)</h3>
|
---|
| 30 |
|
---|
| 31 | <p>The ignore attribute is an attribute to not run a test or test fixture for a
|
---|
| 32 | period of time. The person marks either a Test or a TestFixture with the Ignore
|
---|
| 33 | Attribute. The running program sees the attribute and does not run the test or
|
---|
| 34 | tests. The progress bar will turn yellow if a test is not run and the test will
|
---|
| 35 | be mentioned in the reports that it was not run.</p>
|
---|
| 36 |
|
---|
| 37 | <p>This feature should be used to temporarily not run a test or fixture. This is a
|
---|
| 38 | better mechanism than commenting out the test or renaming methods, since the
|
---|
| 39 | tests will be compiled with the rest of the code and there is an indication at
|
---|
| 40 | run time that a test is not being run. This insures that tests will not be
|
---|
| 41 | forgotten.</p>
|
---|
| 42 |
|
---|
| 43 | <h4>Test Fixture Syntax</h4>
|
---|
| 44 |
|
---|
| 45 | <div class="code">
|
---|
| 46 |
|
---|
| 47 | <div class="langFilter">
|
---|
| 48 | <a href="javascript:Show('DD1')" onmouseover="Show('DD1')"><img src="img/langFilter.gif" width="14" height="14" alt="Language Filter"></a>
|
---|
| 49 | <div id="DD1" class="dropdown" style="display: none;" onclick="Hide('DD1')">
|
---|
| 50 | <a href="javascript:ShowCS()">C#</a><br>
|
---|
| 51 | <a href="javascript:ShowVB()">VB</a><br>
|
---|
| 52 | <a href="javascript:ShowMC()">C++</a><br>
|
---|
| 53 | <a href="javascript:ShowJS()">J#</a><br>
|
---|
| 54 | </div>
|
---|
| 55 | </div>
|
---|
| 56 |
|
---|
| 57 | <pre class="cs">namespace NUnit.Tests
|
---|
| 58 | {
|
---|
| 59 | using System;
|
---|
| 60 | using NUnit.Framework;
|
---|
| 61 |
|
---|
| 62 | [TestFixture]
|
---|
| 63 | [Ignore("Ignore a fixture")]
|
---|
| 64 | public class SuccessTests
|
---|
| 65 | {
|
---|
| 66 | // ...
|
---|
| 67 | }
|
---|
| 68 | }
|
---|
| 69 | </pre>
|
---|
| 70 |
|
---|
| 71 | <pre class="vb">Imports System
|
---|
| 72 | Imports Nunit.Framework
|
---|
| 73 |
|
---|
| 74 | Namespace Nunit.Tests
|
---|
| 75 |
|
---|
| 76 | <TestFixture(), Ignore("Ignore a fixture")>
|
---|
| 77 | Public Class SuccessTests
|
---|
| 78 | ' ...
|
---|
| 79 | End Class
|
---|
| 80 | End Namespace
|
---|
| 81 | </pre>
|
---|
| 82 |
|
---|
| 83 | <pre class="mc">#using <Nunit.Framework.dll>
|
---|
| 84 | using namespace System;
|
---|
| 85 | using namespace NUnit::Framework;
|
---|
| 86 |
|
---|
| 87 | namespace NUnitTests
|
---|
| 88 | {
|
---|
| 89 | [TestFixture]
|
---|
| 90 | [Ignore("Ignore a fixture")]
|
---|
| 91 | public __gc class SuccessTests
|
---|
| 92 | {
|
---|
| 93 | // ...
|
---|
| 94 | };
|
---|
| 95 | }
|
---|
| 96 |
|
---|
| 97 | #include "cppsample.h"
|
---|
| 98 |
|
---|
| 99 | namespace NUnitTests {
|
---|
| 100 | // ...
|
---|
| 101 | }
|
---|
| 102 | </pre>
|
---|
| 103 |
|
---|
| 104 | <pre class="js">package NUnit.Tests;
|
---|
| 105 |
|
---|
| 106 | import System.*;
|
---|
| 107 | import NUnit.Framework.TestFixture;
|
---|
| 108 |
|
---|
| 109 |
|
---|
| 110 | /** @attribute NUnit.Framework.TestFixture() */
|
---|
| 111 | /** @attribute NUnit.Framework.Ignore("Ignore a fixture") */
|
---|
| 112 | public class SuccessTests
|
---|
| 113 | {
|
---|
| 114 | // ...
|
---|
| 115 | }
|
---|
| 116 | </pre>
|
---|
| 117 |
|
---|
| 118 | </div>
|
---|
| 119 |
|
---|
| 120 | <h4>Test Syntax</h4>
|
---|
| 121 |
|
---|
| 122 | <div class="code">
|
---|
| 123 |
|
---|
| 124 | <div class="langFilter">
|
---|
| 125 | <a href="javascript:Show('DD2')" onmouseover="Show('DD2')"><img src="img/langFilter.gif" width="14" height="14" alt="Language Filter"></a>
|
---|
| 126 | <div id="DD2" class="dropdown" style="display: none;" onclick="Hide('DD2')">
|
---|
| 127 | <a href="javascript:ShowCS()">C#</a><br>
|
---|
| 128 | <a href="javascript:ShowVB()">VB</a><br>
|
---|
| 129 | <a href="javascript:ShowMC()">C++</a><br>
|
---|
| 130 | <a href="javascript:ShowJS()">J#</a><br>
|
---|
| 131 | </div>
|
---|
| 132 | </div>
|
---|
| 133 |
|
---|
| 134 | <pre class="cs">namespace NUnit.Tests
|
---|
| 135 | {
|
---|
| 136 | using System;
|
---|
| 137 | using NUnit.Framework;
|
---|
| 138 |
|
---|
| 139 | [TestFixture]
|
---|
| 140 | public class SuccessTests
|
---|
| 141 | {
|
---|
| 142 | [Test]
|
---|
| 143 | [Ignore("Ignore a test")]
|
---|
| 144 | public void IgnoredTest()
|
---|
| 145 | { /* ... */ }
|
---|
| 146 | }
|
---|
| 147 | </pre>
|
---|
| 148 |
|
---|
| 149 | <pre class="vb">Imports System
|
---|
| 150 | Imports Nunit.Framework
|
---|
| 151 |
|
---|
| 152 | Namespace Nunit.Tests
|
---|
| 153 |
|
---|
| 154 | <TestFixture()>
|
---|
| 155 | Public Class SuccessTests
|
---|
| 156 | <Test(), Ignore("Ignore a test")> Public Sub Ignored()
|
---|
| 157 | ' ...
|
---|
| 158 | End Sub
|
---|
| 159 | End Class
|
---|
| 160 | End Namespace
|
---|
| 161 | </pre>
|
---|
| 162 |
|
---|
| 163 | <pre class="mc">#using <Nunit.Framework.dll>
|
---|
| 164 | using namespace System;
|
---|
| 165 | using namespace NUnit::Framework;
|
---|
| 166 |
|
---|
| 167 | namespace NUnitTests
|
---|
| 168 | {
|
---|
| 169 | [TestFixture]
|
---|
| 170 | public __gc class SuccessTests
|
---|
| 171 | {
|
---|
| 172 | [Test][Ignore("Ignore a test")] void IgnoredTest();
|
---|
| 173 | };
|
---|
| 174 | }
|
---|
| 175 |
|
---|
| 176 | #include "cppsample.h"
|
---|
| 177 |
|
---|
| 178 | namespace NUnitTests {
|
---|
| 179 | // ...
|
---|
| 180 | }
|
---|
| 181 | </pre>
|
---|
| 182 |
|
---|
| 183 | <pre class="js">package NUnit.Tests;
|
---|
| 184 |
|
---|
| 185 | import System.*;
|
---|
| 186 | import NUnit.Framework.TestFixture;
|
---|
| 187 |
|
---|
| 188 |
|
---|
| 189 | /** @attribute NUnit.Framework.TestFixture() */
|
---|
| 190 | public class SuccessTests
|
---|
| 191 | {
|
---|
| 192 | /** @attribute NUnit.Framework.Test() */
|
---|
| 193 | /** @attribute NUnit.Framework.Ignore("ignored test") */
|
---|
| 194 | public void IgnoredTest()
|
---|
| 195 | { /* ... */ }
|
---|
| 196 | }
|
---|
| 197 | </pre>
|
---|
| 198 |
|
---|
| 199 | </div>
|
---|
| 200 |
|
---|
| 201 | </div>
|
---|
| 202 |
|
---|
| 203 | <!-- Submenu -->
|
---|
| 204 | <div id="subnav">
|
---|
| 205 | <ul>
|
---|
| 206 | <li><a href="index.html">NUnit 2.5.10</a></li>
|
---|
| 207 | <ul>
|
---|
| 208 | <li><a href="getStarted.html">Getting Started</a></li>
|
---|
| 209 | <li><a href="assertions.html">Assertions</a></li>
|
---|
| 210 | <li><a href="constraintModel.html">Constraints</a></li>
|
---|
| 211 | <li><a href="attributes.html">Attributes</a></li>
|
---|
| 212 | <ul>
|
---|
| 213 | <li><a href="category.html">Category</a></li>
|
---|
| 214 | <li><a href="combinatorial.html">Combinatorial</a></li>
|
---|
| 215 | <li><a href="culture.html">Culture</a></li>
|
---|
| 216 | <li><a href="datapoint.html">Datapoint(s)</a></li>
|
---|
| 217 | <li><a href="description.html">Description</a></li>
|
---|
| 218 | <li><a href="exception.html">Exception</a></li>
|
---|
| 219 | <li><a href="explicit.html">Explicit</a></li>
|
---|
| 220 | <li id="current"><a href="ignore.html">Ignore</a></li>
|
---|
| 221 | <li><a href="maxtime.html">Maxtime</a></li>
|
---|
| 222 | <li><a href="pairwise.html">Pairwise</a></li>
|
---|
| 223 | <li><a href="platform.html">Platform</a></li>
|
---|
| 224 | <li><a href="property.html">Property</a></li>
|
---|
| 225 | <li><a href="random.html">Random</a></li>
|
---|
| 226 | <li><a href="range.html">Range</a></li>
|
---|
| 227 | <li><a href="repeat.html">Repeat</a></li>
|
---|
| 228 | <li><a href="requiredAddin.html">RequiredAddin</a></li>
|
---|
| 229 | <li><a href="requiresMTA.html">Requires MTA</a></li>
|
---|
| 230 | <li><a href="requiresSTA.html">Requires STA</a></li>
|
---|
| 231 | <li><a href="requiresThread.html">Requires Thread</a></li>
|
---|
| 232 | <li><a href="sequential.html">Sequential</a></li>
|
---|
| 233 | <li><a href="setCulture.html">SetCulture</a></li>
|
---|
| 234 | <li><a href="setUICulture.html">SetUICulture</a></li>
|
---|
| 235 | <li><a href="setup.html">Setup</a></li>
|
---|
| 236 | <li><a href="setupFixture.html">SetupFixture</a></li>
|
---|
| 237 | <li><a href="suite.html">Suite</a></li>
|
---|
| 238 | <li><a href="teardown.html">Teardown</a></li>
|
---|
| 239 | <li><a href="test.html">Test</a></li>
|
---|
| 240 | <li><a href="testCase.html">TestCase</a></li>
|
---|
| 241 | <li><a href="testCaseSource.html">TestCaseSource</a></li>
|
---|
| 242 | <li><a href="testFixture.html">TestFixture</a></li>
|
---|
| 243 | <li><a href="fixtureSetup.html">TestFixtureSetUp</a></li>
|
---|
| 244 | <li><a href="fixtureTeardown.html">TestFixtureTearDown</a></li>
|
---|
| 245 | <li><a href="theory.html">Theory</a></li>
|
---|
| 246 | <li><a href="timeout.html">Timeout</a></li>
|
---|
| 247 | <li><a href="values.html">Values</a></li>
|
---|
| 248 | <li><a href="valueSource.html">ValueSource</a></li>
|
---|
| 249 | </ul>
|
---|
| 250 | <li><a href="runningTests.html">Running Tests</a></li>
|
---|
| 251 | <li><a href="extensibility.html">Extensibility</a></li>
|
---|
| 252 | <li><a href="releaseNotes.html">Release Notes</a></li>
|
---|
| 253 | <li><a href="samples.html">Samples</a></li>
|
---|
| 254 | <li><a href="license.html">License</a></li>
|
---|
| 255 | </ul>
|
---|
| 256 | </ul>
|
---|
| 257 | </div>
|
---|
| 258 | <!-- End of Submenu -->
|
---|
| 259 |
|
---|
| 260 |
|
---|
| 261 | <!-- Standard Footer for NUnit.org -->
|
---|
| 262 | <div id="footer">
|
---|
| 263 | Copyright © 2010 Charlie Poole. All Rights Reserved.
|
---|
| 264 | </div>
|
---|
| 265 | <!-- End of Footer -->
|
---|
| 266 |
|
---|
| 267 | </body>
|
---|
| 268 | </html>
|
---|