nunit 2.5.0.9122 → 2.5.1.9189

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. data/docs/addinsDialog.html +1 -1
  2. data/docs/assertions.html +1 -1
  3. data/docs/attributes.html +58 -58
  4. data/docs/category.html +1 -1
  5. data/docs/collectionAssert.html +1 -1
  6. data/docs/collectionConstraints.html +1 -1
  7. data/docs/combinatorial.html +3 -3
  8. data/docs/comparisonAsserts.html +1 -1
  9. data/docs/comparisonConstraints.html +1 -1
  10. data/docs/compoundConstraints.html +1 -1
  11. data/docs/conditionAsserts.html +1 -1
  12. data/docs/conditionConstraints.html +1 -1
  13. data/docs/configEditor.html +1 -1
  14. data/docs/configFiles.html +1 -1
  15. data/docs/consoleCommandLine.html +11 -5
  16. data/docs/constraintModel.html +1 -1
  17. data/docs/contextMenu.html +1 -1
  18. data/docs/culture.html +1 -1
  19. data/docs/customConstraints.html +24 -24
  20. data/docs/datapoint.html +1 -1
  21. data/docs/datapointProviders.html +29 -5
  22. data/docs/delayedConstraint.html +1 -1
  23. data/docs/description.html +1 -1
  24. data/docs/directoryAssert.html +1 -1
  25. data/docs/equalConstraint.html +1 -1
  26. data/docs/equalityAsserts.html +1 -1
  27. data/docs/eventListeners.html +1 -1
  28. data/docs/exception.html +56 -56
  29. data/docs/exceptionAsserts.html +5 -5
  30. data/docs/explicit.html +1 -1
  31. data/docs/extensibility.html +1 -1
  32. data/docs/extensionTips.html +1 -1
  33. data/docs/fileAssert.html +1 -1
  34. data/docs/fixtureSetup.html +1 -1
  35. data/docs/fixtureTeardown.html +1 -1
  36. data/docs/getStarted.html +1 -1
  37. data/docs/guiCommandLine.html +1 -1
  38. data/docs/identityAsserts.html +1 -1
  39. data/docs/ignore.html +1 -1
  40. data/docs/img/generalSettings.jpg +0 -0
  41. data/docs/img/gui-screenshot.jpg +0 -0
  42. data/docs/img/gui-verify.jpg +0 -0
  43. data/docs/img/miniGui.jpg +0 -0
  44. data/docs/index.html +3 -3
  45. data/docs/installation.html +2 -2
  46. data/docs/license.html +3 -3
  47. data/docs/listMapper.html +1 -1
  48. data/docs/mainMenu.html +1 -1
  49. data/docs/maxtime.html +1 -1
  50. data/docs/multiAssembly.html +1 -1
  51. data/docs/nunit-console.html +1 -1
  52. data/docs/nunit-gui.html +1 -1
  53. data/docs/nunitAddins.html +1 -1
  54. data/docs/pairwise.html +1 -1
  55. data/docs/parameterizedTests.html +20 -1
  56. data/docs/pathConstraints.html +1 -1
  57. data/docs/platform.html +1 -1
  58. data/docs/pnunit.html +1 -1
  59. data/docs/projectEditor.html +1 -1
  60. data/docs/property.html +1 -1
  61. data/docs/propertyConstraint.html +1 -1
  62. data/docs/quickStart.html +1 -1
  63. data/docs/random.html +1 -1
  64. data/docs/range.html +1 -1
  65. data/docs/releaseNotes.html +824 -411
  66. data/docs/repeat.html +1 -1
  67. data/docs/requiredAddin.html +1 -1
  68. data/docs/requiresMTA.html +1 -1
  69. data/docs/requiresSTA.html +1 -1
  70. data/docs/requiresThread.html +1 -1
  71. data/docs/sameasConstraint.html +1 -1
  72. data/docs/samples.html +1 -1
  73. data/docs/sequential.html +1 -1
  74. data/docs/setCulture.html +1 -1
  75. data/docs/settingsDialog.html +7 -1
  76. data/docs/setup.html +1 -1
  77. data/docs/setupFixture.html +1 -1
  78. data/docs/stringAssert.html +1 -1
  79. data/docs/stringConstraints.html +154 -23
  80. data/docs/suite.html +1 -1
  81. data/docs/suiteBuilders.html +1 -1
  82. data/docs/teardown.html +1 -1
  83. data/docs/test.html +1 -1
  84. data/docs/testCase.html +56 -56
  85. data/docs/testCaseSource.html +24 -11
  86. data/docs/testDecorators.html +1 -1
  87. data/docs/testFixture.html +11 -11
  88. data/docs/testProperties.html +1 -1
  89. data/docs/testcaseBuilders.html +1 -1
  90. data/docs/testcaseProviders.html +28 -5
  91. data/docs/theory.html +1 -1
  92. data/docs/throwsConstraint.html +46 -17
  93. data/docs/timeout.html +1 -1
  94. data/docs/typeAsserts.html +1 -1
  95. data/docs/typeConstraints.html +1 -1
  96. data/docs/upgrade.html +1 -1
  97. data/docs/utilityAsserts.html +1 -1
  98. data/docs/valueSource.html +19 -10
  99. data/docs/values.html +3 -3
  100. data/docs/vsSupport.html +1 -1
  101. data/lib/net-1.1/framework/nunit.framework.dll +0 -0
  102. data/lib/net-1.1/framework/nunit.framework.xml +105 -19
  103. data/lib/net-1.1/framework/nunit.mocks.dll +0 -0
  104. data/lib/net-1.1/framework/pnunit.framework.dll +0 -0
  105. data/lib/net-1.1/lib/nunit-console-runner.dll +0 -0
  106. data/lib/net-1.1/lib/nunit.core.dll +0 -0
  107. data/lib/net-1.1/lib/nunit.core.interfaces.dll +0 -0
  108. data/lib/net-1.1/lib/nunit.fixtures.dll +0 -0
  109. data/lib/net-1.1/lib/nunit.util.dll +0 -0
  110. data/lib/net-1.1/nunit-agent.exe +0 -0
  111. data/lib/net-1.1/nunit-console.exe +0 -0
  112. data/lib/net-1.1/nunit.framework.dll +0 -0
  113. data/lib/net-1.1/pnunit-agent.exe +0 -0
  114. data/lib/net-1.1/pnunit-launcher.exe +0 -0
  115. data/lib/net-1.1/pnunit.framework.dll +0 -0
  116. data/lib/net-1.1/pnunit.tests.dll +0 -0
  117. data/lib/net-1.1/tests/loadtest-assembly.dll +0 -0
  118. data/lib/net-1.1/tests/mock-assembly.dll +0 -0
  119. data/lib/net-1.1/tests/nonamespace-assembly.dll +0 -0
  120. data/lib/net-1.1/tests/nunit-console.tests.dll +0 -0
  121. data/lib/net-1.1/tests/nunit.core.tests.dll +0 -0
  122. data/lib/net-1.1/tests/nunit.fixtures.tests.dll +0 -0
  123. data/lib/net-1.1/tests/nunit.framework.dll +0 -0
  124. data/lib/net-1.1/tests/nunit.framework.tests.dll +0 -0
  125. data/lib/net-1.1/tests/nunit.mocks.tests.dll +0 -0
  126. data/lib/net-1.1/tests/nunit.util.tests.dll +0 -0
  127. data/lib/net-1.1/tests/test-assembly.dll +0 -0
  128. data/lib/net-1.1/tests/test-utilities.dll +0 -0
  129. data/lib/net-1.1/tests/timing-tests.dll +0 -0
  130. data/lib/net-2.0/framework/nunit.framework.dll +0 -0
  131. data/lib/net-2.0/framework/nunit.framework.xml +113 -19
  132. data/lib/net-2.0/framework/nunit.mocks.dll +0 -0
  133. data/lib/net-2.0/framework/pnunit.framework.dll +0 -0
  134. data/lib/net-2.0/lib/Failure.png +0 -0
  135. data/lib/net-2.0/lib/Ignored.png +0 -0
  136. data/lib/net-2.0/lib/Inconclusive.png +0 -0
  137. data/lib/net-2.0/lib/Skipped.png +0 -0
  138. data/lib/net-2.0/lib/Success.png +0 -0
  139. data/lib/net-2.0/lib/nunit-console-runner.dll +0 -0
  140. data/lib/net-2.0/lib/nunit-gui-runner.dll +0 -0
  141. data/lib/net-2.0/lib/nunit.core.dll +0 -0
  142. data/lib/net-2.0/lib/nunit.core.interfaces.dll +0 -0
  143. data/lib/net-2.0/lib/nunit.fixtures.dll +0 -0
  144. data/lib/net-2.0/lib/nunit.uiexception.dll +0 -0
  145. data/lib/net-2.0/lib/nunit.uikit.dll +0 -0
  146. data/lib/net-2.0/lib/nunit.util.dll +0 -0
  147. data/lib/net-2.0/nunit-agent.exe +0 -0
  148. data/lib/net-2.0/nunit-console-x86.exe +0 -0
  149. data/lib/net-2.0/nunit-console.exe +0 -0
  150. data/lib/net-2.0/nunit-x86.exe +0 -0
  151. data/lib/net-2.0/nunit.exe +0 -0
  152. data/lib/net-2.0/nunit.framework.dll +0 -0
  153. data/lib/net-2.0/pnunit-agent.exe +0 -0
  154. data/lib/net-2.0/pnunit-launcher.exe +0 -0
  155. data/lib/net-2.0/pnunit.framework.dll +0 -0
  156. data/lib/net-2.0/pnunit.tests.dll +0 -0
  157. data/lib/net-2.0/tests/loadtest-assembly.dll +0 -0
  158. data/lib/net-2.0/tests/mock-assembly.dll +0 -0
  159. data/lib/net-2.0/tests/nonamespace-assembly.dll +0 -0
  160. data/lib/net-2.0/tests/nunit-console.tests.dll +0 -0
  161. data/lib/net-2.0/tests/nunit-gui.tests.dll +0 -0
  162. data/lib/net-2.0/tests/nunit.core.tests.dll +0 -0
  163. data/lib/net-2.0/tests/nunit.fixtures.tests.dll +0 -0
  164. data/lib/net-2.0/tests/nunit.framework.dll +0 -0
  165. data/lib/net-2.0/tests/nunit.framework.tests.dll +0 -0
  166. data/lib/net-2.0/tests/nunit.mocks.tests.dll +0 -0
  167. data/lib/net-2.0/tests/nunit.uiexception.tests.dll +0 -0
  168. data/lib/net-2.0/tests/nunit.uikit.tests.dll +0 -0
  169. data/lib/net-2.0/tests/nunit.util.tests.dll +0 -0
  170. data/lib/net-2.0/tests/test-assembly.dll +0 -0
  171. data/lib/net-2.0/tests/test-utilities.dll +0 -0
  172. data/lib/net-2.0/tests/timing-tests.dll +0 -0
  173. metadata +9 -8
  174. data/lib/net-2.0/lib/Failure.jpg +0 -0
  175. data/lib/net-2.0/lib/Gray.jpg +0 -0
  176. data/lib/net-2.0/lib/Ignored.jpg +0 -0
  177. data/lib/net-2.0/lib/Success.jpg +0 -0
@@ -40,7 +40,12 @@ TestCaseSourceAttribute(string sourceName);
40
40
  </div>
41
41
 
42
42
  <p>If <b>sourceType</b> is specified, it represents the class that provides
43
- the test cases. If not, the class containing the test method is used.
43
+ the test cases. It must have a default constructor.
44
+
45
+ <p>If <b>sourceType</b> is not specified, the class containing the test
46
+ method is used. NUnit will construct it using either the default constructor
47
+ or - if arguments are provided - the appropriate constructor for those
48
+ arguments.
44
49
 
45
50
  <p>The <b>sourceName</b> argument represents the name of the source used
46
51
  to provide test cases. It has the following characteristics:
@@ -53,7 +58,8 @@ to provide test cases. It has the following characteristics:
53
58
  The rules for this are described in the next section.
54
59
  </ul>
55
60
 
56
- <h4>Constructing Test Cases</h4>
61
+ <h3>Constructing Test Cases</h3>
62
+
57
63
  <p>In constructing tests, NUnit uses each item test case returned by
58
64
  the enumerator as follows:
59
65
  <ol>
@@ -126,7 +132,9 @@ and any public fields or properties with the following names are used:
126
132
  <dd>Provides a name for the test. If not specified, a name is generated based on
127
133
  the method name and the arguments provided
128
134
  </dl>
129
- <p>
135
+
136
+ <h3>TestCaseData Class</h3>
137
+
130
138
  <p>Although any object with the required fields or properties may be used,
131
139
  NUnit provides the <b>TestCaseData</b> class for this purpose. The following
132
140
  example returns <b>TestCaseData</b> instances from a data source in
@@ -137,9 +145,9 @@ and any public fields or properties with the following names are used:
137
145
  public class MyTests
138
146
  {
139
147
  [Test,TestCaseSource(typeof(MyFactoryClass),"TestCases")]
140
- public void DivideTest(int n, int d, int q)
148
+ public void DivideTest(int n, int d)
141
149
  {
142
- Assert.AreEqual( q, n / d );
150
+ return n/d;
143
151
  }
144
152
 
145
153
  ...
@@ -199,14 +207,19 @@ and methods, which may be appended to an instance in any order.
199
207
  <dd>Specifies a the Type or FullName of an exception that should be thrown by this invocation
200
208
  </dl>
201
209
 
202
- <h4>Note</h4>
210
+ <h3>Note on Object Construction</h3>
211
+
203
212
  <p>NUnit locates the test cases at the time the tests are loaded, creates
204
213
  instances of each class with non-static sources and builds a list of
205
214
  tests to be executed. Each source object is only created once at this
206
- time and is destroyed after all tests are loaded. In the case of test
207
- cases specified within the same class as the tests, a different object
208
- is created each time the test is run, so no communication is possible
209
- using non-static members of the class.
215
+ time and is destroyed after all tests are loaded.
216
+
217
+ <p>If the data source is in the test fixture itself, the object is created
218
+ using the appropriate constructor for the fixture parameters provided, or
219
+ the default constructor if no parameters were specified. Since this object
220
+ is destroyed before the tests are run, no communication is possible between
221
+ these two phases - or between different runs - except through the parameters
222
+ themselves.
210
223
 
211
224
 
212
225
 
@@ -215,7 +228,7 @@ using non-static members of the class.
215
228
  <!-- Submenu -->
216
229
  <div id="subnav">
217
230
  <ul>
218
- <li><a href="index.html">NUnit 2.5</a></li>
231
+ <li><a href="index.html">NUnit 2.5.1</a></li>
219
232
  <ul>
220
233
  <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
221
234
  <li><a href="assertions.html">Assertions</a></li>
@@ -72,7 +72,7 @@ standard values are defined for use if desired:
72
72
  <!-- Submenu -->
73
73
  <div id="subnav">
74
74
  <ul>
75
- <li><a href="index.html">NUnit 2.5</a></li>
75
+ <li><a href="index.html">NUnit 2.5.1</a></li>
76
76
  <ul>
77
77
  <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
78
78
  <li><a href="assertions.html">Assertions</a></li>
@@ -49,7 +49,7 @@
49
49
  since NUnit may construct the object multiple times in the course of a session.</li>
50
50
 
51
51
  <p>Beginning with NUnit 2.5, the <b>TestFixture</b> attribute is optional
52
- for non-paramterized, non-generic fixtures, so long as the class contains
52
+ for non-parameterized, non-generic fixtures, so long as the class contains
53
53
  at least one method marked with the <b>Test</b>,
54
54
  <b>TestCase</b> or <b>TestCaseSource</b> attribute.
55
55
 
@@ -232,7 +232,7 @@ public class IList_Tests&lt;TList&gt; where TList : IList, new()
232
232
  <div class="code"><pre>
233
233
  [TestFixture(typeof(double), typeof(int), 100.0, 42)]
234
234
  [TestFixture(typeof(int) typeof(double), 42, 100.0)]
235
- public class SpecifyBothSetsOfArgs<T1, T2>
235
+ public class SpecifyBothSetsOfArgs&lt;T1, T2&gt;
236
236
  {
237
237
  T1 t1;
238
238
  T2 t2;
@@ -246,8 +246,8 @@ public class SpecifyBothSetsOfArgs<T1, T2>
246
246
  [TestCase(5, 7)]
247
247
  public void TestMyArgTypes(T1 t1, T2 t2)
248
248
  {
249
- Assert.That(t1, Is.TypeOf<T1>());
250
- Assert.That(t2, Is.TypeOf<T2>());
249
+ Assert.That(t1, Is.TypeOf&lt;T1&gt;());
250
+ Assert.That(t2, Is.TypeOf&lt;T2&gt;());
251
251
  }
252
252
  }</pre></div>
253
253
 
@@ -259,7 +259,7 @@ public class SpecifyBothSetsOfArgs<T1, T2>
259
259
  <div class="code" style="width: 40em"><pre>
260
260
  [TestFixture(100.0, 42, TypeArgs=new Type[] {typeof(double), typeof(int) } )]
261
261
  [TestFixture(42, 100.0, TypeArgs=new Type[] {typeof(int), typeof(double) } )]
262
- public class SpecifyTypeArgsSeparately<T1, T2>
262
+ public class SpecifyTypeArgsSeparately&lt;T1, T2&gt;
263
263
  {
264
264
  T1 t1;
265
265
  T2 t2;
@@ -273,8 +273,8 @@ public class SpecifyTypeArgsSeparately<T1, T2>
273
273
  [TestCase(5, 7)]
274
274
  public void TestMyArgTypes(T1 t1, T2 t2)
275
275
  {
276
- Assert.That(t1, Is.TypeOf<T1>());
277
- Assert.That(t2, Is.TypeOf<T2>());
276
+ Assert.That(t1, Is.TypeOf&lt;T1&gt;());
277
+ Assert.That(t2, Is.TypeOf&lt;T2&gt;());
278
278
  }
279
279
  }</pre></div>
280
280
 
@@ -286,7 +286,7 @@ public class SpecifyTypeArgsSeparately<T1, T2>
286
286
  <div class="code"><pre>
287
287
  [TestFixture(100.0, 42)]
288
288
  [TestFixture(42, 100.0)]
289
- public class DeduceTypeArgsFromArgs<T1, T2>
289
+ public class DeduceTypeArgsFromArgs&lt;T1, T2&gt;
290
290
  {
291
291
  T1 t1;
292
292
  T2 t2;
@@ -300,8 +300,8 @@ public class DeduceTypeArgsFromArgs<T1, T2>
300
300
  [TestCase(5, 7)]
301
301
  public void TestMyArgTypes(T1 t1, T2 t2)
302
302
  {
303
- Assert.That(t1, Is.TypeOf<T1>());
304
- Assert.That(t2, Is.TypeOf<T2>());
303
+ Assert.That(t1, Is.TypeOf&lt;T1&gt;());
304
+ Assert.That(t2, Is.TypeOf&lt;T2&gt;());
305
305
  }
306
306
  }</pre></div>
307
307
  </ol>
@@ -311,7 +311,7 @@ public class DeduceTypeArgsFromArgs<T1, T2>
311
311
  <!-- Submenu -->
312
312
  <div id="subnav">
313
313
  <ul>
314
- <li><a href="index.html">NUnit 2.5</a></li>
314
+ <li><a href="index.html">NUnit 2.5.1</a></li>
315
315
  <ul>
316
316
  <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
317
317
  <li><a href="assertions.html">Assertions</a></li>
@@ -39,7 +39,7 @@ which causes it to remain open as the user clicks on different tests.</p>
39
39
  <!-- Submenu -->
40
40
  <div id="subnav">
41
41
  <ul>
42
- <li><a href="index.html">NUnit 2.5</a></li>
42
+ <li><a href="index.html">NUnit 2.5.1</a></li>
43
43
  <ul>
44
44
  <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
45
45
  <li><a href="assertions.html">Assertions</a></li>
@@ -72,7 +72,7 @@ provided as an argument or null if the method cannot be used.
72
72
  <!-- Submenu -->
73
73
  <div id="subnav">
74
74
  <ul>
75
- <li><a href="index.html">NUnit 2.5</a></li>
75
+ <li><a href="index.html">NUnit 2.5.1</a></li>
76
76
  <ul>
77
77
  <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
78
78
  <li><a href="assertions.html">Assertions</a></li>
@@ -37,7 +37,8 @@ specific test cases that will be used in calling the test.
37
37
  IExtensionPoint listeners = host.GetExtensionPoint( "ParameterProviders" );</pre>
38
38
 
39
39
  <h4>Interface</h4>
40
- <p>The extension object passed to Install must implement the ITestCaseProvider interface:
40
+ <p>The extension object passed to Install must implement either the
41
+ <b>ITestCaseProvider</b> or the <b>ITestCaseProvider2</b> interface:
41
42
 
42
43
  <pre>
43
44
  public interface ITestCaseProvider
@@ -45,12 +46,21 @@ specific test cases that will be used in calling the test.
45
46
  bool HasTestCasesFor( MethodInfo method );
46
47
  IEnumerable GetTestCasesFor( MethodInfo method );
47
48
  }
49
+
50
+ public interface ITestCaseProvider2 : ITestCaseProvider
51
+ {
52
+ bool HasTestCasesFor( MethodInfo method, Test suite );
53
+ IEnumerable GetTestCasesFor( MethodInfo method, Test suite );
54
+ }
48
55
  </pre>
49
56
 
50
- <p>HasTestCasesFor returns true if the provider is able to supply test cases
57
+ <p>NUnit will call <b>ITestCaseProvider2</b> if it is available. Otherwise
58
+ <b>ITestCaseProvider</b> will be used.
59
+
60
+ <p><b>HasTestCasesFor</b> should return true if the provider is able to supply test cases
51
61
  for the specified method. If a provider only wants to be used on certain types
52
- of tests, it should examine the provided MethodInfo and return true or false
53
- based on what it finds.
62
+ of tests, it can examine the provided MethodInfo and the suite for which the
63
+ test is being constructed and return true or false based on what it finds.
54
64
 
55
65
  <p>The GetParametersFor method should return a list of individual test cases.
56
66
  Each test case may be expressed as a ParameterSet, as an array of arguments
@@ -70,6 +80,19 @@ specific test cases that will be used in calling the test.
70
80
 
71
81
  <p>The ParameterSet class provides all these properties and may be used
72
82
  to avoid the overhead of reflecting on the properties.
83
+
84
+ <h4>Notes:</h4>
85
+
86
+ <ol>
87
+ <li>Most providers will delegate one of the interface implementations
88
+ to the other if they implement both.
89
+ <li>TestCaseProviders that use data from the fixture class should use
90
+ <b>ITestCaseProvider2</b> interface so that they are able to access any
91
+ arguments supplied for constructing the fixture object.
92
+ <li>Providers that acquire data from outside the fixture will usually
93
+ be able to work with <b>ITestCaseProvider</b> alone.
94
+ <li>The <b>ITestCaseProvider2</b> interface was added in the NUnit 2.5.1 release.
95
+ </ol>
73
96
 
74
97
 
75
98
  </div>
@@ -77,7 +100,7 @@ to avoid the overhead of reflecting on the properties.
77
100
  <!-- Submenu -->
78
101
  <div id="subnav">
79
102
  <ul>
80
- <li><a href="index.html">NUnit 2.5</a></li>
103
+ <li><a href="index.html">NUnit 2.5.1</a></li>
81
104
  <ul>
82
105
  <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
83
106
  <li><a href="assertions.html">Assertions</a></li>
data/docs/theory.html CHANGED
@@ -139,7 +139,7 @@ public class SqrtTests
139
139
  <!-- Submenu -->
140
140
  <div id="subnav">
141
141
  <ul>
142
- <li><a href="index.html">NUnit 2.5</a></li>
142
+ <li><a href="index.html">NUnit 2.5.1</a></li>
143
143
  <ul>
144
144
  <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
145
145
  <li><a href="assertions.html">Assertions</a></li>
@@ -26,46 +26,75 @@
26
26
 
27
27
  <h2>Throws Constraint (NUnit 2.5)</h2>
28
28
 
29
- <p>ThrowsConstraint is used to test that some code, represented as a delegate,
29
+ <p><b>ThrowsConstraint</b> is used to test that some code, represented as a delegate,
30
30
  throws a particular exception. It may be used alone, to merely test the type
31
31
  of constraint, or with an additional constraint to be applied to the exception
32
32
  specified as an argument.
33
33
 
34
- <table class="constraints">
35
- <tr><th>Syntax Helper</th><th>Constructor</th><th>Operation</th></tr>
36
- <tr><td>Throws.Exception(Type)</td><td>ThrowsConstraint(Type)</td></td><td>tests that an exception of the specified type is thrown</td></tr>
37
- <tr><td>Throws.Exception(Type,Constraint)</td><td>ThrowsConstraint(Type,Constraint)</td></td><td>tests that an exception of the specified type is thrown and that it satisifies the constrant provided as the second argument</td></tr>
38
- <tr><td>Throws.Exception&lt;T&gt;()</td><td>ThrowsConstraint&lt;T&gt;()</td></td><td>tests that an exception of the specified type is thrown</td></tr>
39
- <tr><td>Throws.Exception&lt;T&gt;(Constraint)</td><td>ThrowsConstraint&lt;T&gt;(Constraint)</td></td><td>tests that an exception of the specified type is thrown and that it satisifies the constrant provided as an argument</td></tr>
40
- </table>
34
+ p>The related <b>ThrowsNothingConstraint</b> simply asserts that the delegate
35
+ does not throw an exception.
41
36
 
42
- <h4>Examples</h4>
37
+ <h4>Constructors</h4>
38
+ <div class="code"><pre>
39
+ ThrowsConstraint(Type expectedType)
40
+ ThrowsConstraint&lt;T&gt;()
41
+ ThrowsConstraint(Type expectedType, Constraint constraint)
42
+ ThrowsConstraint&lt;T&gt;(Constraint constraint)
43
+ ThrowsNothingConstraint()
44
+ </pre></div>
43
45
 
46
+ <h4>Syntax</h4>
44
47
  <div class="code"><pre>
48
+ Throws.Exception
49
+ Throws.TypeOf(Type expectedType)
50
+ Throws.TypeOf&lt;T&gt;()
51
+ Throws.InstanceOf(Type expectedType)
52
+ Throws.InstanceOf&lt;T&gt;()
53
+ Throws.Nothing
54
+ </pre></div>
45
55
 
56
+ <h4>Examples of Use</h4>
57
+ <div class="code"><pre>
46
58
  // .NET 1.1
47
59
  Assert.That( new TestDelegate(SomeMethod),
48
- Throws.Exception(typeof(ArgumentException)));
60
+ Throws.TypeOf(typeof(ArgumentException)));
61
+ Assert.That( new TestDelegate(SomeMethod),
62
+ Throws.Exception.TypeOf(typeof(ArgumentException)));
49
63
  Assert.That( new TestDelegate(SomeMethod),
50
- Throws.Exception(typeof(ArgumentException),
51
- Has.Property("Parameter", "myParam")));
64
+ Throws.TypeOf(typeof(ArgumentException))
65
+ .With.Property("Parameter").EqualTo("myParam"));
52
66
 
53
67
  // .NET 2.0
54
68
  Assert.That( SomeMethod,
55
- Throws.Exception&lt;ArgumentException&gt;());
69
+ Throws.TypeOf&lt;ArgumentException&gt;());
56
70
  Assert.That( SomeMethod,
57
- Throws.Exception&lt;ArgumentException&gt;(
58
- Has.Property("Parameter", "myParam")));
59
-
71
+ Throws.Exception.TypeOf&lt;ArgumentException&gt;());
72
+ Assert.That( SomeMethod,
73
+ Throws.TypeOf&lt;ArgumentException&gt;()
74
+ .With.Property("Parameter").EqualTo("myParam"));
60
75
  </pre></div>
61
76
 
77
+ <h4>Notes</h4>
78
+ <ol>
79
+ <li><b>Throws.Exception</b> may be followed by further constraints,
80
+ which are applied to the exception itself as shown in the last two
81
+ examples above. It may also be used alone to verify that some
82
+ exception has been thrown, without regard to type. This is
83
+ not a recommended practice since you should normally know
84
+ what exception you are expecting.
85
+ <li><b>Throws.TypeOf</b> and <b>Throws.InstanceOf</b> are provided
86
+ as a shorter syntax for this common test. They work exactly like
87
+ the corresponding forms following <b>Throws.Exception</b>.
88
+ </ol>
89
+
90
+
62
91
 
63
92
  </div>
64
93
 
65
94
  <!-- Submenu -->
66
95
  <div id="subnav">
67
96
  <ul>
68
- <li><a href="index.html">NUnit 2.5</a></li>
97
+ <li><a href="index.html">NUnit 2.5.1</a></li>
69
98
  <ul>
70
99
  <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
71
100
  <li><a href="assertions.html">Assertions</a></li>
data/docs/timeout.html CHANGED
@@ -40,7 +40,7 @@
40
40
  <!-- Submenu -->
41
41
  <div id="subnav">
42
42
  <ul>
43
- <li><a href="index.html">NUnit 2.5</a></li>
43
+ <li><a href="index.html">NUnit 2.5.1</a></li>
44
44
  <ul>
45
45
  <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
46
46
  <li><a href="assertions.html">Assertions</a></li>
@@ -89,7 +89,7 @@ Assert.IsNotAssignableFrom&lt;T&gt;( object actual,
89
89
  <!-- Submenu -->
90
90
  <div id="subnav">
91
91
  <ul>
92
- <li><a href="index.html">NUnit 2.5</a></li>
92
+ <li><a href="index.html">NUnit 2.5.1</a></li>
93
93
  <ul>
94
94
  <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
95
95
  <li><a href="assertions.html">Assertions</a></li>
@@ -59,7 +59,7 @@ Expect( "Hello", AssignableFrom(typeOf(string)));
59
59
  <!-- Submenu -->
60
60
  <div id="subnav">
61
61
  <ul>
62
- <li><a href="index.html">NUnit 2.5</a></li>
62
+ <li><a href="index.html">NUnit 2.5.1</a></li>
63
63
  <ul>
64
64
  <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
65
65
  <li><a href="assertions.html">Assertions</a></li>
data/docs/upgrade.html CHANGED
@@ -64,7 +64,7 @@ in order for your tests to load correctly.
64
64
  <!-- Submenu -->
65
65
  <div id="subnav">
66
66
  <ul>
67
- <li><a href="index.html">NUnit 2.5</a></li>
67
+ <li><a href="index.html">NUnit 2.5.1</a></li>
68
68
  <ul>
69
69
  <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
70
70
  <ul>
@@ -85,7 +85,7 @@ public void AssertStringContains( string expected, string actual,
85
85
  <!-- Submenu -->
86
86
  <div id="subnav">
87
87
  <ul>
88
- <li><a href="index.html">NUnit 2.5</a></li>
88
+ <li><a href="index.html">NUnit 2.5.1</a></li>
89
89
  <ul>
90
90
  <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
91
91
  <li><a href="assertions.html">Assertions</a></li>
@@ -40,7 +40,12 @@ ValueSourceAttribute(string sourceName);
40
40
  </div>
41
41
 
42
42
  <p>If <b>sourceType</b> is specified, it represents the class that provides
43
- the data. If not, the class containing the test method is used.
43
+ the data. It must have a default constructor.
44
+
45
+ <p>If <b>sourceType</b> is not specified, the class containing the test
46
+ method is used. NUnit will construct it using either the default constructor
47
+ or - if arguments are provided - the appropriate constructor for those
48
+ arguments.
44
49
 
45
50
  <p>The <b>sourceName</b>, represents the name of the source that will
46
51
  provide the arguments. It should have the following characteristics:
@@ -53,22 +58,26 @@ provide the arguments. It should have the following characteristics:
53
58
  <li>
54
59
  </ul>
55
60
 
56
- <p>NUnit locates value sources at the time the tests are loaded, creates
57
- instances of each class having non-static sources and builds a list of
58
- tests to be executed. Each instance is only created once at this
59
- time and is destroyed after all tests are loaded. In the case of sources
60
- located within the same class as the tests, a different instance is created
61
- each time the test is run, so no communication is possible using non-static
62
- members of the class.
61
+ <h3>Note on Object Construction</h3>
62
+
63
+ <p>NUnit locates the test cases at the time the tests are loaded, creates
64
+ instances of each class with non-static sources and builds a list of
65
+ tests to be executed. Each source object is only created once at this
66
+ time and is destroyed after all tests are loaded.
63
67
 
64
-
68
+ <p>If the data source is in the test fixture itself, the object is created
69
+ using the appropriate constructor for the fixture parameters provided, or
70
+ the default constructor if no parameters were specified. Since this object
71
+ is destroyed before the tests are run, no communication is possible between
72
+ these two phases - or between different runs - except through the parameters
73
+ themselves.
65
74
 
66
75
  </div>
67
76
 
68
77
  <!-- Submenu -->
69
78
  <div id="subnav">
70
79
  <ul>
71
- <li><a href="index.html">NUnit 2.5</a></li>
80
+ <li><a href="index.html">NUnit 2.5.1</a></li>
72
81
  <ul>
73
82
  <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
74
83
  <li><a href="assertions.html">Assertions</a></li>