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 - Explicit</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>ExplicitAttribute (NUnit 2.2)</h3>
|
---|
30 |
|
---|
31 | <p>The Explicit attribute causes a test or test fixture to be ignored unless it is
|
---|
32 | explicitly selected for running. The test or fixture will be run if it is
|
---|
33 | selected in the gui, if its name is specified on the console runner command
|
---|
34 | line as the fixture to run or if it is included by use of a Category filter.</p>
|
---|
35 |
|
---|
36 | <p>An optional string argument may be used to give the reason for marking
|
---|
37 | the test Explicit.</p>
|
---|
38 |
|
---|
39 | <p>If a test or fixture with the Explicit attribute is encountered in the course of
|
---|
40 | running tests, it is skipped unless it has been specifically selected by one
|
---|
41 | of the above means. The test does not affect the outcome of the run at all:
|
---|
42 | it is not considered as ignored and is not even counted in the total number
|
---|
43 | of tests. In the gui, the tree node for the test remains gray and the
|
---|
44 | status bar color is not affected.</p>
|
---|
45 |
|
---|
46 | <blockquote><i><b>Note:</b> In versions of NUnit prior to 2.4, these tests were
|
---|
47 | shown as ignored.</i></blockquote>
|
---|
48 |
|
---|
49 | <h4>Test Fixture Syntax</h4>
|
---|
50 |
|
---|
51 | <div id="trace">
|
---|
52 | </div>
|
---|
53 |
|
---|
54 | <div class="code cs">
|
---|
55 |
|
---|
56 | <div class="langFilter">
|
---|
57 | <a href="javascript:Show('DD1')" onmouseover="Show('DD1')"><img src="img/langFilter.gif" width="14" height="14" alt="Language Filter"></a>
|
---|
58 | <div id="DD1" class="dropdown" style="display: none;" onclick="Hide('DD1')">
|
---|
59 | <a href="javascript:ShowCS()">C#</a><br>
|
---|
60 | <a href="javascript:ShowVB()">VB</a><br>
|
---|
61 | <a href="javascript:ShowMC()">C++</a><br>
|
---|
62 | <a href="javascript:ShowJS()">J#</a><br>
|
---|
63 | </div>
|
---|
64 | </div>
|
---|
65 |
|
---|
66 | <pre class="cs">namespace NUnit.Tests
|
---|
67 | {
|
---|
68 | using System;
|
---|
69 | using NUnit.Framework;
|
---|
70 |
|
---|
71 | [TestFixture, Explicit]
|
---|
72 | public class ExplicitTests
|
---|
73 | {
|
---|
74 | // ...
|
---|
75 | }
|
---|
76 | }
|
---|
77 | </pre>
|
---|
78 |
|
---|
79 | <pre class="vb">Imports System
|
---|
80 | Imports Nunit.Framework
|
---|
81 |
|
---|
82 | Namespace Nunit.Tests
|
---|
83 |
|
---|
84 | <TestFixture(), Explicit()>
|
---|
85 | Public Class ExplicitTests
|
---|
86 | ' ...
|
---|
87 | End Class
|
---|
88 | End Namespace
|
---|
89 | </pre>
|
---|
90 |
|
---|
91 | <pre class="mc">#using <Nunit.Framework.dll>
|
---|
92 | using namespace System;
|
---|
93 | using namespace NUnit::Framework;
|
---|
94 |
|
---|
95 | namespace NUnitTests
|
---|
96 | {
|
---|
97 | [TestFixture]
|
---|
98 | [Explicit]
|
---|
99 | public __gc class ExplicitTests
|
---|
100 | {
|
---|
101 | // ...
|
---|
102 | };
|
---|
103 | }
|
---|
104 |
|
---|
105 | #include "cppsample.h"
|
---|
106 |
|
---|
107 | namespace NUnitTests {
|
---|
108 | // ...
|
---|
109 | }
|
---|
110 | </pre>
|
---|
111 |
|
---|
112 | <pre class="js">package NUnit.Tests;
|
---|
113 |
|
---|
114 | import System.*;
|
---|
115 | import NUnit.Framework.TestFixture;
|
---|
116 |
|
---|
117 |
|
---|
118 | /** @attribute NUnit.Framework.TestFixture() */
|
---|
119 | /** @attribute NUnit.Framework.Explicit() */
|
---|
120 | public class ExplicitTests
|
---|
121 | {
|
---|
122 | // ...
|
---|
123 | }
|
---|
124 | </pre>
|
---|
125 |
|
---|
126 | </div>
|
---|
127 |
|
---|
128 | <h4>Test Syntax</h4>
|
---|
129 |
|
---|
130 | <div class="code">
|
---|
131 |
|
---|
132 | <div class="langFilter">
|
---|
133 | <a href="javascript:Show('DD2')" onmouseover="Show('DD2')"><img src="img/langFilter.gif" width="14" height="14" alt="Language Filter"></a>
|
---|
134 | <div id="DD2" class="dropdown" style="display: none;" onclick="Hide('DD2')">
|
---|
135 | <a href="javascript:ShowCS()">C#</a><br>
|
---|
136 | <a href="javascript:ShowVB()">VB</a><br>
|
---|
137 | <a href="javascript:ShowMC()">C++</a><br>
|
---|
138 | <a href="javascript:ShowJS()">J#</a><br>
|
---|
139 | </div>
|
---|
140 | </div>
|
---|
141 |
|
---|
142 | <pre class="cs">namespace NUnit.Tests
|
---|
143 | {
|
---|
144 | using System;
|
---|
145 | using NUnit.Framework;
|
---|
146 |
|
---|
147 | [TestFixture]
|
---|
148 | public class SuccessTests
|
---|
149 | {
|
---|
150 | [Test, Explicit]
|
---|
151 | public void ExplicitTest()
|
---|
152 | { /* ... */ }
|
---|
153 | }
|
---|
154 | </pre>
|
---|
155 |
|
---|
156 | <pre class="vb">Imports System
|
---|
157 | Imports Nunit.Framework
|
---|
158 |
|
---|
159 | Namespace Nunit.Tests
|
---|
160 |
|
---|
161 | <TestFixture()>
|
---|
162 | Public Class SuccessTests
|
---|
163 | <Test(), Explicit()> Public Sub ExplicitTest()
|
---|
164 | ' ...
|
---|
165 | End Sub
|
---|
166 | End Class
|
---|
167 | End Namespace
|
---|
168 | </pre>
|
---|
169 |
|
---|
170 | <pre class="mc">#using <Nunit.Framework.dll>
|
---|
171 | using namespace System;
|
---|
172 | using namespace NUnit::Framework;
|
---|
173 |
|
---|
174 | namespace NUnitTests
|
---|
175 | {
|
---|
176 | [TestFixture]
|
---|
177 | public __gc class SuccessTests
|
---|
178 | {
|
---|
179 | [Test][Explicit] void ExplicitTest();
|
---|
180 | };
|
---|
181 | }
|
---|
182 |
|
---|
183 | #include "cppsample.h"
|
---|
184 |
|
---|
185 | namespace NUnitTests {
|
---|
186 | // ...
|
---|
187 | }
|
---|
188 | </pre>
|
---|
189 |
|
---|
190 | <pre class="js">package NUnit.Tests;
|
---|
191 |
|
---|
192 | import System.*;
|
---|
193 | import NUnit.Framework.TestFixture;
|
---|
194 |
|
---|
195 |
|
---|
196 | /** @attribute NUnit.Framework.TestFixture() */
|
---|
197 | public class SuccessTests
|
---|
198 | {
|
---|
199 | /** @attribute NUnit.Framework.Test() */
|
---|
200 | /** @attribute NUnit.Framework.Explicit() */
|
---|
201 | public void ExplicitTest()
|
---|
202 | { /* ... */ }
|
---|
203 | }
|
---|
204 | </pre>
|
---|
205 |
|
---|
206 | </div>
|
---|
207 |
|
---|
208 | </div>
|
---|
209 |
|
---|
210 | <!-- Submenu -->
|
---|
211 | <div id="subnav">
|
---|
212 | <ul>
|
---|
213 | <li><a href="index.html">NUnit 2.5.10</a></li>
|
---|
214 | <ul>
|
---|
215 | <li><a href="getStarted.html">Getting Started</a></li>
|
---|
216 | <li><a href="assertions.html">Assertions</a></li>
|
---|
217 | <li><a href="constraintModel.html">Constraints</a></li>
|
---|
218 | <li><a href="attributes.html">Attributes</a></li>
|
---|
219 | <ul>
|
---|
220 | <li><a href="category.html">Category</a></li>
|
---|
221 | <li><a href="combinatorial.html">Combinatorial</a></li>
|
---|
222 | <li><a href="culture.html">Culture</a></li>
|
---|
223 | <li><a href="datapoint.html">Datapoint(s)</a></li>
|
---|
224 | <li><a href="description.html">Description</a></li>
|
---|
225 | <li><a href="exception.html">Exception</a></li>
|
---|
226 | <li id="current"><a href="explicit.html">Explicit</a></li>
|
---|
227 | <li><a href="ignore.html">Ignore</a></li>
|
---|
228 | <li><a href="maxtime.html">Maxtime</a></li>
|
---|
229 | <li><a href="pairwise.html">Pairwise</a></li>
|
---|
230 | <li><a href="platform.html">Platform</a></li>
|
---|
231 | <li><a href="property.html">Property</a></li>
|
---|
232 | <li><a href="random.html">Random</a></li>
|
---|
233 | <li><a href="range.html">Range</a></li>
|
---|
234 | <li><a href="repeat.html">Repeat</a></li>
|
---|
235 | <li><a href="requiredAddin.html">RequiredAddin</a></li>
|
---|
236 | <li><a href="requiresMTA.html">Requires MTA</a></li>
|
---|
237 | <li><a href="requiresSTA.html">Requires STA</a></li>
|
---|
238 | <li><a href="requiresThread.html">Requires Thread</a></li>
|
---|
239 | <li><a href="sequential.html">Sequential</a></li>
|
---|
240 | <li><a href="setCulture.html">SetCulture</a></li>
|
---|
241 | <li><a href="setUICulture.html">SetUICulture</a></li>
|
---|
242 | <li><a href="setup.html">Setup</a></li>
|
---|
243 | <li><a href="setupFixture.html">SetupFixture</a></li>
|
---|
244 | <li><a href="suite.html">Suite</a></li>
|
---|
245 | <li><a href="teardown.html">Teardown</a></li>
|
---|
246 | <li><a href="test.html">Test</a></li>
|
---|
247 | <li><a href="testCase.html">TestCase</a></li>
|
---|
248 | <li><a href="testCaseSource.html">TestCaseSource</a></li>
|
---|
249 | <li><a href="testFixture.html">TestFixture</a></li>
|
---|
250 | <li><a href="fixtureSetup.html">TestFixtureSetUp</a></li>
|
---|
251 | <li><a href="fixtureTeardown.html">TestFixtureTearDown</a></li>
|
---|
252 | <li><a href="theory.html">Theory</a></li>
|
---|
253 | <li><a href="timeout.html">Timeout</a></li>
|
---|
254 | <li><a href="values.html">Values</a></li>
|
---|
255 | <li><a href="valueSource.html">ValueSource</a></li>
|
---|
256 | </ul>
|
---|
257 | <li><a href="runningTests.html">Running Tests</a></li>
|
---|
258 | <li><a href="extensibility.html">Extensibility</a></li>
|
---|
259 | <li><a href="releaseNotes.html">Release Notes</a></li>
|
---|
260 | <li><a href="samples.html">Samples</a></li>
|
---|
261 | <li><a href="license.html">License</a></li>
|
---|
262 | </ul>
|
---|
263 | </ul>
|
---|
264 | </div>
|
---|
265 | <!-- End of Submenu -->
|
---|
266 |
|
---|
267 |
|
---|
268 | <!-- Standard Footer for NUnit.org -->
|
---|
269 | <div id="footer">
|
---|
270 | Copyright © 2010 Charlie Poole. All Rights Reserved.
|
---|
271 | </div>
|
---|
272 | <!-- End of Footer -->
|
---|
273 |
|
---|
274 | </body>
|
---|
275 | </html>
|
---|