source: BMXNET_RPMS_dotNET_UTILITIES-BMX/branch/IHS BMX Framework/lib/NUnit/NUnit-2.5.10.11092/doc/parameterizedTests.html@ 1146

Last change on this file since 1146 was 1146, checked in by Sam Habiel, 13 years ago

Initial Import of BMX4

File size: 6.2 KB
Line 
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 - ParameterizedTests</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<h2>Parameterized Tests</h2>
28
29<p>NUnit 2.5 supports parameterized tests. Test methods
30may have parameters and various attributes are available
31to indicate what arguments should be supplied by NUnit.
32
33<p>Multiple sets of arguments cause the creation of multiple
34tests. All arguments are created at the point of loading the
35tests, so the individual test cases are available for
36display and selection in the Gui, if desired.
37
38<p>Some attributes allow you to specify arguments inline - directly on
39 the attribute - while others use a separate method, property or field
40 to hold the arguments. In addition, some attributes identify complete test cases,
41 including all the necessary arguments, while others only provide data
42 for a single argument. This gives rise to four groups of attributes,
43 as shown in the following table.
44
45<table class="nunit">
46<tr><th></th><th>Complete Test Cases</th><th>Data for One Argument</th></tr>
47<tr><th>Inline</th>
48 <td><a href="testCase.html">TestCaseAttribute</a></td>
49 <td><a href="random.html">RandomAttribute</a><br>
50 <a href="range.html">RangeAttribute</a><br>
51 <a href="values.html">ValuesAttribute</a></td></tr>
52<tr><th>Separate</th>
53 <td><a href="testCaseSource.html">TestCaseSourceAttribute</a></td>
54 <td><a href="valueSource.html">ValueSourceAttribute</a></td></tr>
55</table>
56
57<p>In addition, when data is specified for individual arguments, special attributes
58may be added to the test method itself in order to tell NUnit how
59to go about combining the arguments. Currently, the following attributes
60are provided:
61
62<ul>
63<li><a href="combinatorial.html">CombinatorialAttribute</a> (default)
64<li><a href="pairwise.html">PairwiseAttribute</a><li><a href="sequential.html">SequentialAttribute</a></ul>
65
66<h3>Order of Execution</h3>
67
68<p>In NUnit 2.5, individual test cases are sorted alphabetically and executed in
69 that order. With NUnit 2.5.1, the individual cases are not sorted, but are
70 executed in the order in which NUnit discovers them. This order does <b>not</b>
71 follow the lexical order of the attributes and will often vary between different
72 compilers or different versions of the CLR.
73
74<p>The following specific rules for ordering apply:
75<ol>
76<li>If all arguments are specified in a <b>single TestCaseSource</b> attribute,
77 the ordering of the cases provided will be maintained.
78<li>If each parameter has a <b>single Values</b>, <b>ValueSource</b> or
79 <b>Range</b> attribute and the <b>Sequential</b> combining strategy
80 is used - or there is only one argument - the ordering will be maintained.
81<li>In all other cases, including using multiple <b>TestCase</b> attributes
82 or a combination of different types of attributes, the ordering of the
83 test cases is undefined.
84</ol>
85
86</div>
87
88<!-- Submenu -->
89<div id="subnav">
90<ul>
91<li><a href="index.html">NUnit 2.5.10</a></li>
92<ul>
93<li><a href="getStarted.html">Getting&nbsp;Started</a></li>
94<li><a href="assertions.html">Assertions</a></li>
95<li><a href="constraintModel.html">Constraints</a></li>
96<li><a href="attributes.html">Attributes</a></li>
97<ul>
98<li><a href="category.html">Category</a></li>
99<li><a href="combinatorial.html">Combinatorial</a></li>
100<li><a href="culture.html">Culture</a></li>
101<li><a href="datapoint.html">Datapoint(s)</a></li>
102<li><a href="description.html">Description</a></li>
103<li><a href="exception.html">Exception</a></li>
104<li><a href="explicit.html">Explicit</a></li>
105<li><a href="ignore.html">Ignore</a></li>
106<li><a href="maxtime.html">Maxtime</a></li>
107<li><a href="pairwise.html">Pairwise</a></li>
108<li><a href="platform.html">Platform</a></li>
109<li><a href="property.html">Property</a></li>
110<li><a href="random.html">Random</a></li>
111<li><a href="range.html">Range</a></li>
112<li><a href="repeat.html">Repeat</a></li>
113<li><a href="requiredAddin.html">RequiredAddin</a></li>
114<li><a href="requiresMTA.html">Requires&nbsp;MTA</a></li>
115<li><a href="requiresSTA.html">Requires&nbsp;STA</a></li>
116<li><a href="requiresThread.html">Requires&nbsp;Thread</a></li>
117<li><a href="sequential.html">Sequential</a></li>
118<li><a href="setCulture.html">SetCulture</a></li>
119<li><a href="setUICulture.html">SetUICulture</a></li>
120<li><a href="setup.html">Setup</a></li>
121<li><a href="setupFixture.html">SetupFixture</a></li>
122<li><a href="suite.html">Suite</a></li>
123<li><a href="teardown.html">Teardown</a></li>
124<li><a href="test.html">Test</a></li>
125<ul>
126<li id="current"><a href="parameterizedTests.html">Parameterized&nbsp;Tests</a></li>
127</ul>
128<li><a href="testCase.html">TestCase</a></li>
129<li><a href="testCaseSource.html">TestCaseSource</a></li>
130<li><a href="testFixture.html">TestFixture</a></li>
131<li><a href="fixtureSetup.html">TestFixtureSetUp</a></li>
132<li><a href="fixtureTeardown.html">TestFixtureTearDown</a></li>
133<li><a href="theory.html">Theory</a></li>
134<li><a href="timeout.html">Timeout</a></li>
135<li><a href="values.html">Values</a></li>
136<li><a href="valueSource.html">ValueSource</a></li>
137</ul>
138<li><a href="runningTests.html">Running&nbsp;Tests</a></li>
139<li><a href="extensibility.html">Extensibility</a></li>
140<li><a href="releaseNotes.html">Release&nbsp;Notes</a></li>
141<li><a href="samples.html">Samples</a></li>
142<li><a href="license.html">License</a></li>
143</ul>
144</ul>
145</div>
146<!-- End of Submenu -->
147
148
149<!-- Standard Footer for NUnit.org -->
150<div id="footer">
151 Copyright &copy; 2010 Charlie Poole. All Rights Reserved.
152</div>
153<!-- End of Footer -->
154
155</body>
156</html>
Note: See TracBrowser for help on using the repository browser.