1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
<!-- saved from url=(0014)about:internet --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<!-- Standard Head Part -->
<head>
<title>NUnit - Datapoint</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-US">
<link rel="stylesheet" type="text/css" href="nunit.css">
<link rel="shortcut icon" href="favicon.ico">
</head>
<!-- End Standard Head Part -->
<body>
<!-- Standard Header for NUnit.org -->
<div id="header">
<a id="logo" href="http://www.nunit.org"><img src="img/logo.gif" alt="NUnit.org" title="NUnit.org"></a>
<div id="nav">
<a href="http://www.nunit.org">NUnit</a>
<a class="active" href="index.html">Documentation</a>
</div>
</div>
<!-- End of Header -->
<div id="content">
<h3>DatapointAttribute / DatapointsAttribute (NUnit 2.5) (Experimental)</h3>
<p>The <b>Datapoint</b> and <b>Datapoints</b> attributes are used
to provide data for <b>Theories</b> and are ignored for ordinary
tests - including tests with parameters.
<h4>DataPointAttribute</h4>
<p>When a Theory is loaded, NUnit creates arguments for each
of its parameters by using any fields of the same type
as the parameter annotated with the <b>DatapointAttribute</b>.
Fields must be members of the class containing the Theory
and their Type must exactly match the argument for which
data is being supplied.
<h4>DataPointsAttribute</h4>
<p>In addition to specifying individual datapoints, collections of
datapoints may be provided by use of the <b>DatapointsAttribute</b>
- note the spelling. This attribute may be placed on methods or
properties in addition to fields. The returned value must be
either an array of the required type or (beginning with NUnit
2.5.5) an <b>IEnumerable<T></b> returning an enumeration
of the required type. The data Type must exactly match the argument
for which data is being supplied.
<h4>Automatically Supplied Datapoints</h4>
<p>It is normally not necessary to specify datapoints for
<b>boolean</b> or <b>enum</b> arguments. Beginning with
version 2.5.4, NUnit automatically supplies values of <b>true</b>
and <b>false</b> for <b>boolean</b> arguments and will supply all
defined values of any enumeration.
<p>If for some reason you don't wish to use all possible values, you
can override this behavior by supplying your own datapoints. If you
supply any datapoints for an argument, automatic datapoint generation
is suppressed.
<h4>Example</h4>
<p>For an example of use, see <a href="theory.html">TheoryAttribute</a>.
<h4>See also...</h4>
<ul>
<li><a href="theory.html">TheoryAttribute</a><li><a href="parameterizedTests.html">Parameterized Tests</a></ul>
</div>
<!-- Submenu -->
<div id="subnav">
<ul>
<li><a href="index.html">NUnit 2.5.9</a></li>
<ul>
<li><a href="getStarted.html">Getting Started</a></li>
<li><a href="assertions.html">Assertions</a></li>
<li><a href="constraintModel.html">Constraints</a></li>
<li><a href="attributes.html">Attributes</a></li>
<ul>
<li><a href="category.html">Category</a></li>
<li><a href="combinatorial.html">Combinatorial</a></li>
<li><a href="culture.html">Culture</a></li>
<li id="current"><a href="datapoint.html">Datapoint(s)</a></li>
<li><a href="description.html">Description</a></li>
<li><a href="exception.html">Exception</a></li>
<li><a href="explicit.html">Explicit</a></li>
<li><a href="ignore.html">Ignore</a></li>
<li><a href="maxtime.html">Maxtime</a></li>
<li><a href="pairwise.html">Pairwise</a></li>
<li><a href="platform.html">Platform</a></li>
<li><a href="property.html">Property</a></li>
<li><a href="random.html">Random</a></li>
<li><a href="range.html">Range</a></li>
<li><a href="repeat.html">Repeat</a></li>
<li><a href="requiredAddin.html">RequiredAddin</a></li>
<li><a href="requiresMTA.html">Requires MTA</a></li>
<li><a href="requiresSTA.html">Requires STA</a></li>
<li><a href="requiresThread.html">Requires Thread</a></li>
<li><a href="sequential.html">Sequential</a></li>
<li><a href="setCulture.html">SetCulture</a></li>
<li><a href="setup.html">Setup</a></li>
<li><a href="setupFixture.html">SetupFixture</a></li>
<li><a href="suite.html">Suite</a></li>
<li><a href="teardown.html">Teardown</a></li>
<li><a href="test.html">Test</a></li>
<li><a href="testCase.html">TestCase</a></li>
<li><a href="testCaseSource.html">TestCaseSource</a></li>
<li><a href="testFixture.html">TestFixture</a></li>
<li><a href="fixtureSetup.html">TestFixtureSetUp</a></li>
<li><a href="fixtureTeardown.html">TestFixtureTearDown</a></li>
<li><a href="theory.html">Theory</a></li>
<li><a href="timeout.html">Timeout</a></li>
<li><a href="values.html">Values</a></li>
<li><a href="valueSource.html">ValueSource</a></li>
</ul>
<li><a href="runningTests.html">Running Tests</a></li>
<li><a href="extensibility.html">Extensibility</a></li>
<li><a href="releaseNotes.html">Release Notes</a></li>
<li><a href="samples.html">Samples</a></li>
<li><a href="license.html">License</a></li>
</ul>
</ul>
</div>
<!-- End of Submenu -->
<!-- Standard Footer for NUnit.org -->
<div id="footer">
Copyright © 2010 Charlie Poole. All Rights Reserved.
</div>
<!-- End of Footer -->
</body>
</html>
|