nunit 2.4.8.0 → 2.5.0.9122

Sign up to get free protection for your applications and to get access to all the features.
Files changed (276) hide show
  1. data/docs/addinsDialog.html +36 -6
  2. data/docs/assertions.html +31 -12
  3. data/docs/attributes.html +59 -36
  4. data/docs/category.html +32 -9
  5. data/docs/collectionAssert.html +30 -12
  6. data/docs/collectionConstraints.html +242 -44
  7. data/docs/combinatorial.html +130 -0
  8. data/docs/comparisonAsserts.html +12 -9
  9. data/docs/comparisonConstraints.html +159 -25
  10. data/docs/compoundConstraints.html +12 -9
  11. data/docs/conditionAsserts.html +36 -12
  12. data/docs/conditionConstraints.html +131 -25
  13. data/docs/configEditor.html +10 -5
  14. data/docs/configFiles.html +5 -6
  15. data/docs/consoleCommandLine.html +51 -24
  16. data/docs/constraintModel.html +56 -19
  17. data/docs/contextMenu.html +10 -5
  18. data/docs/culture.html +32 -9
  19. data/docs/customConstraints.html +53 -37
  20. data/docs/datapoint.html +124 -0
  21. data/docs/datapointProviders.html +105 -0
  22. data/docs/delayedConstraint.html +98 -0
  23. data/docs/description.html +32 -9
  24. data/docs/directoryAssert.html +151 -0
  25. data/docs/equalConstraint.html +167 -47
  26. data/docs/equalityAsserts.html +12 -9
  27. data/docs/eventListeners.html +110 -0
  28. data/docs/exception.html +61 -36
  29. data/docs/exceptionAsserts.html +210 -0
  30. data/docs/explicit.html +32 -9
  31. data/docs/extensibility.html +8 -8
  32. data/docs/extensionTips.html +100 -0
  33. data/docs/fileAssert.html +12 -9
  34. data/docs/files/TestResult.xml +99 -67
  35. data/docs/fixtureSetup.html +60 -18
  36. data/docs/fixtureTeardown.html +56 -17
  37. data/docs/getStarted.html +9 -4
  38. data/docs/guiCommandLine.html +10 -5
  39. data/docs/identityAsserts.html +12 -9
  40. data/docs/ignore.html +32 -9
  41. data/docs/img/addinsDialog.JPG +0 -0
  42. data/docs/img/advancedSettings.jpg +0 -0
  43. data/docs/img/assembliesTab.jpg +0 -0
  44. data/docs/img/assemblyReloadSettings.JPG +0 -0
  45. data/docs/img/configEditor.jpg +0 -0
  46. data/docs/img/console-mock.jpg +0 -0
  47. data/docs/img/generalSettings.jpg +0 -0
  48. data/docs/img/generalTab.jpg +0 -0
  49. data/docs/img/gui-screenshot.jpg +0 -0
  50. data/docs/img/gui-verify.jpg +0 -0
  51. data/docs/img/miniGui.jpg +0 -0
  52. data/docs/img/testLoadSettings.jpg +0 -0
  53. data/docs/img/testOutputSettings.jpg +0 -0
  54. data/docs/img/testProperties.jpg +0 -0
  55. data/docs/img/testResultSettings.JPG +0 -0
  56. data/docs/img/textOutputSettings.jpg +0 -0
  57. data/docs/img/treeDisplaySettings.jpg +0 -0
  58. data/docs/img/visualStudioSettings.jpg +0 -0
  59. data/docs/index.html +15 -8
  60. data/docs/installation.html +33 -75
  61. data/docs/license.html +9 -4
  62. data/docs/listMapper.html +12 -9
  63. data/docs/mainMenu.html +18 -8
  64. data/docs/maxtime.html +109 -0
  65. data/docs/multiAssembly.html +5 -6
  66. data/docs/nunit-console.html +9 -4
  67. data/docs/nunit-gui.html +32 -15
  68. data/docs/nunit.css +3 -3
  69. data/docs/nunitAddins.html +41 -144
  70. data/docs/pairwise.html +114 -0
  71. data/docs/parameterizedTests.html +141 -0
  72. data/docs/pathConstraints.html +162 -0
  73. data/docs/platform.html +37 -9
  74. data/docs/pnunit.html +93 -0
  75. data/docs/projectEditor.html +82 -11
  76. data/docs/property.html +39 -10
  77. data/docs/propertyConstraint.html +12 -9
  78. data/docs/quickStart.html +9 -4
  79. data/docs/random.html +138 -0
  80. data/docs/range.html +149 -0
  81. data/docs/releaseDetail.html +861 -0
  82. data/docs/releaseNotes.html +457 -1133
  83. data/docs/repeat.html +104 -0
  84. data/docs/requiredAddin.html +153 -0
  85. data/docs/requiresMTA.html +152 -0
  86. data/docs/requiresSTA.html +153 -0
  87. data/docs/requiresThread.html +153 -0
  88. data/docs/sameasConstraint.html +23 -17
  89. data/docs/samples.html +12 -9
  90. data/docs/sequential.html +132 -0
  91. data/docs/setCulture.html +32 -9
  92. data/docs/{optionsDialog.html → settingsDialog.html} +89 -53
  93. data/docs/setup.html +61 -16
  94. data/docs/setupFixture.html +32 -9
  95. data/docs/stringAssert.html +15 -12
  96. data/docs/stringConstraints.html +12 -9
  97. data/docs/suite.html +32 -11
  98. data/docs/suiteBuilders.html +106 -0
  99. data/docs/teardown.html +56 -16
  100. data/docs/test.html +67 -18
  101. data/docs/testCase.html +168 -0
  102. data/docs/testCaseSource.html +284 -0
  103. data/docs/testDecorators.html +117 -0
  104. data/docs/testFixture.html +228 -16
  105. data/docs/testProperties.html +10 -5
  106. data/docs/testcaseBuilders.html +117 -0
  107. data/docs/testcaseProviders.html +122 -0
  108. data/docs/theory.html +208 -0
  109. data/docs/throwsConstraint.html +112 -0
  110. data/docs/timeout.html +109 -0
  111. data/docs/typeAsserts.html +47 -14
  112. data/docs/typeConstraints.html +12 -9
  113. data/docs/upgrade.html +23 -17
  114. data/docs/utilityAsserts.html +38 -16
  115. data/docs/valueSource.html +137 -0
  116. data/docs/values.html +136 -0
  117. data/docs/vsSupport.html +5 -6
  118. data/lib/net-1.1/NUnitTests.config +2 -2
  119. data/lib/net-1.1/NUnitTests.nunit +8 -11
  120. data/lib/net-1.1/agent.conf +4 -0
  121. data/lib/net-1.1/agent.log.conf +18 -0
  122. data/lib/net-1.1/framework/nunit.framework.dll +0 -0
  123. data/lib/net-1.1/framework/nunit.framework.xml +9321 -0
  124. data/lib/net-1.1/framework/nunit.mocks.dll +0 -0
  125. data/lib/net-1.1/framework/pnunit.framework.dll +0 -0
  126. data/lib/net-1.1/launcher.log.conf +18 -0
  127. data/lib/net-1.1/{fit.dll → lib/fit.dll} +0 -0
  128. data/lib/net-1.1/lib/log4net.dll +0 -0
  129. data/lib/net-1.1/lib/nunit-console-runner.dll +0 -0
  130. data/lib/net-1.1/lib/nunit.core.dll +0 -0
  131. data/lib/net-1.1/lib/nunit.core.interfaces.dll +0 -0
  132. data/lib/net-1.1/lib/nunit.fixtures.dll +0 -0
  133. data/lib/net-1.1/lib/nunit.util.dll +0 -0
  134. data/lib/net-1.1/nunit-agent.exe +0 -0
  135. data/lib/net-1.1/{nunit.exe.config → nunit-agent.exe.config} +21 -55
  136. data/lib/net-1.1/nunit-console.exe +0 -0
  137. data/lib/net-1.1/nunit-console.exe.config +19 -49
  138. data/lib/net-1.1/nunit.framework.dll +0 -0
  139. data/lib/net-1.1/pnunit-agent.exe +0 -0
  140. data/lib/net-1.1/pnunit-agent.exe.config +87 -0
  141. data/lib/net-1.1/pnunit-launcher.exe +0 -0
  142. data/lib/net-1.1/pnunit-launcher.exe.config +87 -0
  143. data/lib/net-1.1/pnunit.framework.dll +0 -0
  144. data/lib/net-1.1/pnunit.tests.dll +0 -0
  145. data/lib/net-1.1/runpnunit.bat +2 -0
  146. data/lib/net-1.1/test.conf +24 -0
  147. data/lib/net-1.1/{loadtest-assembly.dll → tests/loadtest-assembly.dll} +0 -0
  148. data/lib/net-1.1/tests/mock-assembly.dll +0 -0
  149. data/lib/net-1.1/tests/nonamespace-assembly.dll +0 -0
  150. data/lib/net-1.1/tests/nunit-console.tests.dll +0 -0
  151. data/lib/net-1.1/tests/nunit.core.tests.dll +0 -0
  152. data/lib/net-1.1/tests/nunit.fixtures.tests.dll +0 -0
  153. data/lib/net-1.1/tests/nunit.framework.dll +0 -0
  154. data/lib/net-1.1/tests/nunit.framework.tests.dll +0 -0
  155. data/lib/net-1.1/tests/nunit.mocks.tests.dll +0 -0
  156. data/lib/net-1.1/{nunit.util.tests.dll → tests/nunit.util.tests.dll} +0 -0
  157. data/lib/net-1.1/tests/test-assembly.dll +0 -0
  158. data/lib/net-1.1/tests/test-utilities.dll +0 -0
  159. data/lib/net-1.1/tests/timing-tests.dll +0 -0
  160. data/lib/net-2.0/NUnitTests.config +2 -2
  161. data/lib/net-2.0/NUnitTests.nunit +11 -11
  162. data/lib/net-2.0/agent.conf +4 -0
  163. data/lib/net-2.0/agent.log.conf +18 -0
  164. data/lib/net-2.0/framework/nunit.framework.dll +0 -0
  165. data/lib/net-2.0/framework/nunit.framework.xml +9803 -0
  166. data/lib/net-2.0/framework/nunit.mocks.dll +0 -0
  167. data/lib/net-2.0/framework/pnunit.framework.dll +0 -0
  168. data/lib/net-2.0/launcher.log.conf +18 -0
  169. data/lib/{net-1.1 → net-2.0/lib}/Failure.jpg +0 -0
  170. data/lib/net-2.0/{Success.jpg → lib/Gray.jpg} +0 -0
  171. data/lib/{net-1.1 → net-2.0/lib}/Ignored.jpg +0 -0
  172. data/lib/{net-1.1 → net-2.0/lib}/Success.jpg +0 -0
  173. data/lib/net-2.0/{fit.dll → lib/fit.dll} +0 -0
  174. data/lib/net-2.0/lib/log4net.dll +0 -0
  175. data/lib/net-2.0/lib/nunit-console-runner.dll +0 -0
  176. data/lib/net-2.0/lib/nunit-gui-runner.dll +0 -0
  177. data/lib/net-2.0/lib/nunit.core.dll +0 -0
  178. data/lib/net-2.0/lib/nunit.core.interfaces.dll +0 -0
  179. data/lib/net-2.0/lib/nunit.fixtures.dll +0 -0
  180. data/lib/net-2.0/lib/nunit.uiexception.dll +0 -0
  181. data/lib/net-2.0/lib/nunit.uikit.dll +0 -0
  182. data/lib/net-2.0/lib/nunit.util.dll +0 -0
  183. data/lib/net-2.0/nunit-agent.exe +0 -0
  184. data/lib/net-2.0/nunit-agent.exe.config +87 -0
  185. data/lib/net-2.0/nunit-console-x86.exe +0 -0
  186. data/lib/net-2.0/nunit-console-x86.exe.config +19 -49
  187. data/lib/net-2.0/nunit-console.exe +0 -0
  188. data/lib/net-2.0/nunit-console.exe.config +19 -49
  189. data/lib/net-2.0/nunit-x86.exe +0 -0
  190. data/lib/net-2.0/nunit-x86.exe.config +48 -74
  191. data/lib/net-2.0/nunit.exe +0 -0
  192. data/lib/net-2.0/nunit.exe.config +48 -74
  193. data/lib/net-2.0/nunit.framework.dll +0 -0
  194. data/lib/net-2.0/pnunit-agent.exe +0 -0
  195. data/lib/net-2.0/pnunit-agent.exe.config +87 -0
  196. data/lib/net-2.0/pnunit-launcher.exe +0 -0
  197. data/lib/net-2.0/pnunit-launcher.exe.config +87 -0
  198. data/lib/net-2.0/pnunit.framework.dll +0 -0
  199. data/lib/net-2.0/pnunit.tests.dll +0 -0
  200. data/lib/net-2.0/runpnunit.bat +2 -0
  201. data/lib/net-2.0/test.conf +24 -0
  202. data/lib/net-2.0/{loadtest-assembly.dll → tests/loadtest-assembly.dll} +0 -0
  203. data/lib/net-2.0/tests/mock-assembly.dll +0 -0
  204. data/lib/net-2.0/tests/nonamespace-assembly.dll +0 -0
  205. data/lib/net-2.0/tests/nunit-console.tests.dll +0 -0
  206. data/lib/net-2.0/tests/nunit-gui.tests.dll +0 -0
  207. data/lib/net-2.0/tests/nunit.core.tests.dll +0 -0
  208. data/lib/net-2.0/tests/nunit.fixtures.tests.dll +0 -0
  209. data/lib/net-2.0/tests/nunit.framework.dll +0 -0
  210. data/lib/net-2.0/tests/nunit.framework.tests.dll +0 -0
  211. data/lib/net-2.0/tests/nunit.mocks.tests.dll +0 -0
  212. data/lib/net-2.0/tests/nunit.uiexception.tests.dll +0 -0
  213. data/lib/net-2.0/tests/nunit.uikit.tests.dll +0 -0
  214. data/lib/net-2.0/{nunit.util.tests.dll → tests/nunit.util.tests.dll} +0 -0
  215. data/lib/net-2.0/tests/test-assembly.dll +0 -0
  216. data/lib/net-2.0/tests/test-utilities.dll +0 -0
  217. data/lib/net-2.0/tests/timing-tests.dll +0 -0
  218. metadata +131 -74
  219. data/docs/classicModel.html +0 -92
  220. data/docs/customAsserts.html +0 -115
  221. data/docs/features.html +0 -75
  222. data/docs/files/Thumbs.db +0 -0
  223. data/docs/platformSupport.html +0 -99
  224. data/lib/net-1.1/mock-assembly.dll +0 -0
  225. data/lib/net-1.1/nonamespace-assembly.dll +0 -0
  226. data/lib/net-1.1/notestfixtures-assembly.dll +0 -0
  227. data/lib/net-1.1/nunit-console-runner.dll +0 -0
  228. data/lib/net-1.1/nunit-console.tests.dll +0 -0
  229. data/lib/net-1.1/nunit-gui-runner.dll +0 -0
  230. data/lib/net-1.1/nunit-gui.tests.dll +0 -0
  231. data/lib/net-1.1/nunit.core.dll +0 -0
  232. data/lib/net-1.1/nunit.core.extensions.dll +0 -0
  233. data/lib/net-1.1/nunit.core.interfaces.dll +0 -0
  234. data/lib/net-1.1/nunit.core.tests.dll +0 -0
  235. data/lib/net-1.1/nunit.exe +0 -0
  236. data/lib/net-1.1/nunit.extensions.tests.dll +0 -0
  237. data/lib/net-1.1/nunit.fixtures.dll +0 -0
  238. data/lib/net-1.1/nunit.fixtures.tests.dll +0 -0
  239. data/lib/net-1.1/nunit.framework.extensions.dll +0 -0
  240. data/lib/net-1.1/nunit.framework.tests.dll +0 -0
  241. data/lib/net-1.1/nunit.framework.xml +0 -5622
  242. data/lib/net-1.1/nunit.mocks.dll +0 -0
  243. data/lib/net-1.1/nunit.mocks.tests.dll +0 -0
  244. data/lib/net-1.1/nunit.uikit.dll +0 -0
  245. data/lib/net-1.1/nunit.uikit.tests.dll +0 -0
  246. data/lib/net-1.1/nunit.util.dll +0 -0
  247. data/lib/net-1.1/test-assembly.dll +0 -0
  248. data/lib/net-1.1/test-utilities.dll +0 -0
  249. data/lib/net-1.1/timing-tests.dll +0 -0
  250. data/lib/net-2.0/Failure.jpg +0 -0
  251. data/lib/net-2.0/Ignored.jpg +0 -0
  252. data/lib/net-2.0/mock-assembly.dll +0 -0
  253. data/lib/net-2.0/nonamespace-assembly.dll +0 -0
  254. data/lib/net-2.0/notestfixtures-assembly.dll +0 -0
  255. data/lib/net-2.0/nunit-console-runner.dll +0 -0
  256. data/lib/net-2.0/nunit-console.tests.dll +0 -0
  257. data/lib/net-2.0/nunit-gui-runner.dll +0 -0
  258. data/lib/net-2.0/nunit-gui.tests.dll +0 -0
  259. data/lib/net-2.0/nunit.core.dll +0 -0
  260. data/lib/net-2.0/nunit.core.extensions.dll +0 -0
  261. data/lib/net-2.0/nunit.core.interfaces.dll +0 -0
  262. data/lib/net-2.0/nunit.core.tests.dll +0 -0
  263. data/lib/net-2.0/nunit.extensions.tests.dll +0 -0
  264. data/lib/net-2.0/nunit.fixtures.dll +0 -0
  265. data/lib/net-2.0/nunit.fixtures.tests.dll +0 -0
  266. data/lib/net-2.0/nunit.framework.extensions.dll +0 -0
  267. data/lib/net-2.0/nunit.framework.tests.dll +0 -0
  268. data/lib/net-2.0/nunit.framework.xml +0 -5622
  269. data/lib/net-2.0/nunit.mocks.dll +0 -0
  270. data/lib/net-2.0/nunit.mocks.tests.dll +0 -0
  271. data/lib/net-2.0/nunit.uikit.dll +0 -0
  272. data/lib/net-2.0/nunit.uikit.tests.dll +0 -0
  273. data/lib/net-2.0/nunit.util.dll +0 -0
  274. data/lib/net-2.0/test-assembly.dll +0 -0
  275. data/lib/net-2.0/test-utilities.dll +0 -0
  276. data/lib/net-2.0/timing-tests.dll +0 -0
@@ -0,0 +1,117 @@
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 - TestDecorators</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
+ <h3>TestDecorators (NUnit 2.4)</h3>
28
+
29
+ <h4>Purpose</h4>
30
+ <p>TestDecorators are able to modify a test after it has been constructed.
31
+
32
+ <h4>Extension Point</h4>
33
+ <p>Addins use the host to access this extension point by name:
34
+
35
+ <pre>
36
+ IExtensionPoint testDecorators = host.GetExtensionPoint( "TestDecorators" );</pre>
37
+
38
+ <h4>Interface</h4>
39
+ <p>The extension object passed to Install must implement the ITestDecorator interface:
40
+
41
+ <pre>
42
+ public interface ITestDecorator
43
+ {
44
+ Test Decorate( Test test, MemberInfo member );
45
+ }
46
+ </pre>
47
+
48
+ <p>The Decorate method may do several things, depending on what it needs
49
+ to accomplish:
50
+ <ol>
51
+ <li>Return test unmodified
52
+ <li>Modify properties of the test object and return it
53
+ <li>Replace test with another object, either discarding the
54
+ original or aggregating it in the new test.
55
+ </ol>
56
+
57
+ <p>Depending on what the decorator does, it may need to run
58
+ ahead of other decorators or after them. Decorators should
59
+ be installed using the Install method overload that takes
60
+ a priority. The priorities range from 1 to 9 and decorators
61
+ with lower priority values are installed first. The following
62
+ standard values are defined for use if desired:
63
+ <ul>
64
+ <li>DecoratorPriority.Default = 0
65
+ <li>DecoratorPriority.First = 1
66
+ <li>DecoratorPriority.Normal = 5
67
+ <li>DecoratorPriority.Last = 9
68
+ </ul>
69
+
70
+ </div>
71
+
72
+ <!-- Submenu -->
73
+ <div id="subnav">
74
+ <ul>
75
+ <li><a href="index.html">NUnit 2.5</a></li>
76
+ <ul>
77
+ <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
78
+ <li><a href="assertions.html">Assertions</a></li>
79
+ <li><a href="constraintModel.html">Constraints</a></li>
80
+ <li><a href="attributes.html">Attributes</a></li>
81
+ <li><a href="nunit-console.html">Console&nbsp;Runner</a></li>
82
+ <li><a href="nunit-gui.html">Gui&nbsp;Runner</a></li>
83
+ <li><a href="configFiles.html">Configuration&nbsp;Files</a></li>
84
+ <li><a href="pnunit.html">PNUnit</a></li>
85
+ <li><a href="multiAssembly.html">Multiple&nbsp;Assemblies</a></li>
86
+ <li><a href="vsSupport.html">Visual&nbsp;Studio&nbsp;Support</a></li>
87
+ <li><a href="extensibility.html">Extensibility</a></li>
88
+ <ul>
89
+ <li><a href="customConstraints.html">Custom&nbsp;Constraints</a></li>
90
+ <li><a href="nunitAddins.html">NUnit&nbsp;Addins</a></li>
91
+ <ul>
92
+ <li><a href="suiteBuilders.html">SuiteBuilders</a></li>
93
+ <li><a href="testcaseBuilders.html">TestcaseBuilders</a></li>
94
+ <li id="current"><a href="testDecorators.html">TestDecorators</a></li>
95
+ <li><a href="testcaseProviders.html">TestcaseProviders</a></li>
96
+ <li><a href="datapointProviders.html">DatapointProviders</a></li>
97
+ <li><a href="eventListeners.html">EventListeners</a></li>
98
+ </ul>
99
+ <li><a href="extensionTips.html">Tips&nbsp;for&nbsp;Extenders</a></li>
100
+ </ul>
101
+ <li><a href="releaseNotes.html">Release&nbsp;Notes</a></li>
102
+ <li><a href="samples.html">Samples</a></li>
103
+ <li><a href="license.html">License</a></li>
104
+ </ul>
105
+ </ul>
106
+ </div>
107
+ <!-- End of Submenu -->
108
+
109
+
110
+ <!-- Standard Footer for NUnit.org -->
111
+ <div id="footer">
112
+ Copyright &copy; 2009 Charlie Poole. All Rights Reserved.
113
+ </div>
114
+ <!-- End of Footer -->
115
+
116
+ </body>
117
+ </html>
@@ -1,4 +1,4 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
1
+ <!-- saved from url=(0014)about:internet --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2
2
  <html>
3
3
  <!-- Standard Head Part -->
4
4
  <head>
@@ -26,25 +26,33 @@
26
26
 
27
27
  <script language="JavaScript" src="codeFuncs.js" ></script> <!-- Do it this way for IE -->
28
28
 
29
- <h3>TestFixtureAttribute (NUnit 2.0)</h3>
29
+ <h3>TestFixtureAttribute (NUnit 2.0 / 2.5)</h3>
30
+
30
31
  <p>This is the attribute that marks a class that contains tests and, optionally,
31
- setup or teardown methods.</p>
32
+ setup or teardown methods. NUnit 2.5 introduces parameterized and generic
33
+ test fixtures - see below.</p>
34
+
32
35
  <p>There are a few restrictions on a class that is used as a test fixture.
33
36
  <ul>
34
37
  <li>It must be a publicly exported type.</li>
35
38
  <li>It must have not be abstract.</li>
36
- <li>It must have a default constructor</li>
37
- <li>It must have no more than one of each of the following method
38
- types: SetUp, TearDown, TestFixtureSetUp and TestFixtureTearDown.</li>
39
+ <li>A non-parameterized fixture must have a default constructor.
40
+ <li>A parameterized fixture must have a constructor that matches
41
+ the parameters provided.
39
42
  </ul>
40
43
  </p>
41
44
 
42
- <p>If any of these restrictions are violated, the class will be shown as a
43
- non-runnable test fixture, and will turn yellow in the Gui if you attempt to run it.</p>
45
+ <p>If any of these restrictions are violated, the class is not runnable
46
+ as a test and will display as an error in the Gui.</p>
44
47
 
45
48
  <p>In addition, it is advisable that the constructor not have any side effects,
46
49
  since NUnit may construct the object multiple times in the course of a session.</li>
47
50
 
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
53
+ at least one method marked with the <b>Test</b>,
54
+ <b>TestCase</b> or <b>TestCaseSource</b> attribute.
55
+
48
56
  <h4>Example:</h4>
49
57
 
50
58
  <div class="code">
@@ -115,40 +123,244 @@ public class SuccessTests
115
123
  // ...
116
124
  }
117
125
  </pre>
126
+
118
127
  </div>
119
128
 
129
+ <h3>Parameterized Test Fixtures (NUnit 2.5)</h3>
130
+
131
+ <p>Beginning with NUnit 2.5, test fixtures may take constructor arguments.
132
+ Argument values are specified as arguments to the <b>TestFixture</b>
133
+ attribute. NUnit will construct a separate instance of the fixture
134
+ for each set of arguments.
135
+
136
+ <h4>Example</h4>
137
+
138
+ <p>The following test fixture would be instantiated by NUnit three times,
139
+ passing in each set of arguments to the appropriate constructor. Note
140
+ that there are three different constructors, matching the data types
141
+ provided as arguments.
142
+
143
+ <div class="code"><pre>
144
+ [TestFixture("hello", "hello", "goodbye")]
145
+ [TestFixture("zip", "zip")]
146
+ [TestFixture(42, 42, 99)]
147
+ public class ParameterizedTestFixture
148
+ {
149
+ private string eq1;
150
+ private string eq2;
151
+ private string neq;
152
+
153
+ public ParameterizedTestFixture(string eq1, string eq2, string neq)
154
+ {
155
+ this.eq1 = eq1;
156
+ this.eq2 = eq2;
157
+ this.neq = neq;
158
+ }
159
+
160
+ public ParameterizedTestFixture(string eq1, string eq2)
161
+ : this(eq1, eq2, null) { }
162
+
163
+ public ParameterizedTestFixture(int eq1, int eq2, int neq)
164
+ {
165
+ this.eq1 = eq1.ToString();
166
+ this.eq2 = eq2.ToString();
167
+ this.neq = neq.ToString();
168
+ }
169
+
170
+ [Test]
171
+ public void TestEquality()
172
+ {
173
+ Assert.AreEqual(eq1, eq2);
174
+ if (eq1 != null &amp;&amp; eq2 != null)
175
+ Assert.AreEqual(eq1.GetHashCode(), eq2.GetHashCode());
176
+ }
177
+
178
+ [Test]
179
+ public void TestInequality()
180
+ {
181
+ Assert.AreNotEqual(eq1, neq);
182
+ if (eq1 != null &amp;&amp; neq != null)
183
+ Assert.AreNotEqual(eq1.GetHashCode(), neq.GetHashCode());
184
+ }
185
+ }
186
+ </pre></div>
187
+
188
+ <h3>Generic Test Fixtures (NUnit 2.5)</h3>
189
+
190
+ <p>Beginning with NUnit 2.5, you may use a generic class as a test fixture.
191
+ In order for NUnit to instantiate the fixture, you must specify the
192
+ types to be used as arguments to <b>TestFixtureAttribute</b>, which
193
+ may now appear multiple times on the class.
194
+
195
+ <h4>Example</h4>
196
+
197
+ <p>The following test fixture would be instantiated by NUnit twice,
198
+ once using an ArrayList and once using a List<int>.
199
+
200
+ <div class="code"><pre>
201
+ [TestFixture(typeof(ArrayList))]
202
+ [TestFixture(typeof(List&lt;int&gt;))]
203
+ public class IList_Tests&lt;TList&gt; where TList : IList, new()
204
+ {
205
+ private IList list;
206
+
207
+ [SetUp]
208
+ public void CreateList()
209
+ {
210
+ this.list = new TList();
211
+ }
212
+
213
+ [Test]
214
+ public void CanAddToList()
215
+ {
216
+ list.Add(1); list.Add(2); list.Add(3);
217
+ Assert.AreEqual(3, list.Count);
218
+ }
219
+ }</pre></div>
220
+
221
+ <h3>Generic Test Fixtures with Parameters (NUnit 2.5)</h3>
222
+
223
+ <p>If a Generic fixture, uses constructor arguments, there are three
224
+ approaches to telling NUnit which arguments are type parameters
225
+ and which are normal constructor parameters.
226
+ <ol>
227
+ <li>Specify both sets of parameters as arguments to the <b>TestFixtureAttribute</b>.
228
+ Leading <b>System.Type</b> arguments are used as type parameters, while
229
+ any remaining arguments are used to construct the instance. In the
230
+ following example, this leads to some obvious duplication...
231
+
232
+ <div class="code"><pre>
233
+ [TestFixture(typeof(double), typeof(int), 100.0, 42)]
234
+ [TestFixture(typeof(int) typeof(double), 42, 100.0)]
235
+ public class SpecifyBothSetsOfArgs<T1, T2>
236
+ {
237
+ T1 t1;
238
+ T2 t2;
239
+
240
+ public SpecifyBothSetsOfArgs(T1 t1, T2 t2)
241
+ {
242
+ this.t1 = t1;
243
+ this.t2 = t2;
244
+ }
245
+
246
+ [TestCase(5, 7)]
247
+ public void TestMyArgTypes(T1 t1, T2 t2)
248
+ {
249
+ Assert.That(t1, Is.TypeOf<T1>());
250
+ Assert.That(t2, Is.TypeOf<T2>());
251
+ }
252
+ }</pre></div>
253
+
254
+ <li>Specify normal parameters as arguments to <b>TestFixtureAttribute</b>
255
+ and use the named parameter <b>TypeArgs=</b> to specify the type
256
+ arguments. Again, for this example, the type info is duplicated, but
257
+ it is at least more cleanly separated from the normal arguments...
258
+
259
+ <div class="code" style="width: 40em"><pre>
260
+ [TestFixture(100.0, 42, TypeArgs=new Type[] {typeof(double), typeof(int) } )]
261
+ [TestFixture(42, 100.0, TypeArgs=new Type[] {typeof(int), typeof(double) } )]
262
+ public class SpecifyTypeArgsSeparately<T1, T2>
263
+ {
264
+ T1 t1;
265
+ T2 t2;
266
+
267
+ public SpecifyTypeArgsSeparately(T1 t1, T2 t2)
268
+ {
269
+ this.t1 = t1;
270
+ this.t2 = t2;
271
+ }
272
+
273
+ [TestCase(5, 7)]
274
+ public void TestMyArgTypes(T1 t1, T2 t2)
275
+ {
276
+ Assert.That(t1, Is.TypeOf<T1>());
277
+ Assert.That(t2, Is.TypeOf<T2>());
278
+ }
279
+ }</pre></div>
280
+
281
+ <li>In some cases, when the constructor makes use of all the type parameters
282
+ NUnit may simply be able to deduce them from the arguments provided.
283
+ That's the case here and the following is the preferred way to
284
+ write this example...
285
+
286
+ <div class="code"><pre>
287
+ [TestFixture(100.0, 42)]
288
+ [TestFixture(42, 100.0)]
289
+ public class DeduceTypeArgsFromArgs<T1, T2>
290
+ {
291
+ T1 t1;
292
+ T2 t2;
293
+
294
+ public DeduceTypeArgsFromArgs(T1 t1, T2 t2)
295
+ {
296
+ this.t1 = t1;
297
+ this.t2 = t2;
298
+ }
299
+
300
+ [TestCase(5, 7)]
301
+ public void TestMyArgTypes(T1 t1, T2 t2)
302
+ {
303
+ Assert.That(t1, Is.TypeOf<T1>());
304
+ Assert.That(t2, Is.TypeOf<T2>());
305
+ }
306
+ }</pre></div>
307
+ </ol>
308
+
120
309
  </div>
121
310
 
122
311
  <!-- Submenu -->
123
312
  <div id="subnav">
124
313
  <ul>
125
- <li><a href="index.html">NUnit 2.4.8</a></li>
314
+ <li><a href="index.html">NUnit 2.5</a></li>
126
315
  <ul>
127
316
  <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
128
317
  <li><a href="assertions.html">Assertions</a></li>
318
+ <li><a href="constraintModel.html">Constraints</a></li>
129
319
  <li><a href="attributes.html">Attributes</a></li>
130
320
  <ul>
131
321
  <li><a href="category.html">Category</a></li>
322
+ <li><a href="combinatorial.html">Combinatorial</a></li>
132
323
  <li><a href="culture.html">Culture</a></li>
324
+ <li><a href="datapoint.html">Datapoint(s)</a></li>
133
325
  <li><a href="description.html">Description</a></li>
134
- <li><a href="exception.html">Expected&nbsp;Exception</a></li>
326
+ <li><a href="exception.html">Exception</a></li>
135
327
  <li><a href="explicit.html">Explicit</a></li>
136
328
  <li><a href="ignore.html">Ignore</a></li>
329
+ <li><a href="maxtime.html">Maxtime</a></li>
330
+ <li><a href="pairwise.html">Pairwise</a></li>
137
331
  <li><a href="platform.html">Platform</a></li>
138
332
  <li><a href="property.html">Property</a></li>
333
+ <li><a href="random.html">Random</a></li>
334
+ <li><a href="range.html">Range</a></li>
335
+ <li><a href="repeat.html">Repeat</a></li>
336
+ <li><a href="requiredAddin.html">RequiredAddin</a></li>
337
+ <li><a href="requiresMTA.html">Requires&nbsp;MTA</a></li>
338
+ <li><a href="requiresSTA.html">Requires&nbsp;STA</a></li>
339
+ <li><a href="requiresThread.html">Requires&nbsp;Thread</a></li>
340
+ <li><a href="sequential.html">Sequential</a></li>
139
341
  <li><a href="setCulture.html">SetCulture</a></li>
140
342
  <li><a href="setup.html">Setup</a></li>
141
- <li><a href="setupFixture.html">SetUp&nbsp;Fixture</a></li>
343
+ <li><a href="setupFixture.html">SetupFixture</a></li>
142
344
  <li><a href="suite.html">Suite</a></li>
143
345
  <li><a href="teardown.html">Teardown</a></li>
144
346
  <li><a href="test.html">Test</a></li>
145
- <li id="current"><a href="testFixture.html">Test&nbsp;Fixture</a></li>
146
- <li><a href="fixtureSetup.html">Test&nbsp;Fixture&nbsp;SetUp</a></li>
147
- <li><a href="fixtureTeardown.html">Test&nbsp;Fixture&nbsp;TearDown</a></li>
347
+ <li><a href="testCase.html">TestCase</a></li>
348
+ <li><a href="testCaseSource.html">TestCaseSource</a></li>
349
+ <li id="current"><a href="testFixture.html">TestFixture</a></li>
350
+ <li><a href="fixtureSetup.html">TestFixtureSetUp</a></li>
351
+ <li><a href="fixtureTeardown.html">TestFixtureTearDown</a></li>
352
+ <li><a href="theory.html">Theory</a></li>
353
+ <li><a href="timeout.html">Timeout</a></li>
354
+ <li><a href="values.html">Values</a></li>
355
+ <li><a href="valueSource.html">ValueSource</a></li>
148
356
  </ul>
149
357
  <li><a href="nunit-console.html">Console&nbsp;Runner</a></li>
150
358
  <li><a href="nunit-gui.html">Gui&nbsp;Runner</a></li>
151
- <li><a href="features.html">Other&nbsp;Features</a></li>
359
+ <li><a href="configFiles.html">Configuration&nbsp;Files</a></li>
360
+ <li><a href="pnunit.html">PNUnit</a></li>
361
+ <li><a href="multiAssembly.html">Multiple&nbsp;Assemblies</a></li>
362
+ <li><a href="vsSupport.html">Visual&nbsp;Studio&nbsp;Support</a></li>
363
+ <li><a href="extensibility.html">Extensibility</a></li>
152
364
  <li><a href="releaseNotes.html">Release&nbsp;Notes</a></li>
153
365
  <li><a href="samples.html">Samples</a></li>
154
366
  <li><a href="license.html">License</a></li>
@@ -160,7 +372,7 @@ public class SuccessTests
160
372
 
161
373
  <!-- Standard Footer for NUnit.org -->
162
374
  <div id="footer">
163
- Copyright &copy; 2008 Charlie Poole. All Rights Reserved.
375
+ Copyright &copy; 2009 Charlie Poole. All Rights Reserved.
164
376
  </div>
165
377
  <!-- End of Footer -->
166
378
 
@@ -1,4 +1,4 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
1
+ <!-- saved from url=(0014)about:internet --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2
2
  <html>
3
3
  <!-- Standard Head Part -->
4
4
  <head>
@@ -39,10 +39,11 @@ 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.4.8</a></li>
42
+ <li><a href="index.html">NUnit 2.5</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>
46
+ <li><a href="constraintModel.html">Constraints</a></li>
46
47
  <li><a href="attributes.html">Attributes</a></li>
47
48
  <li><a href="nunit-console.html">Console&nbsp;Runner</a></li>
48
49
  <li><a href="nunit-gui.html">Gui&nbsp;Runner</a></li>
@@ -50,13 +51,17 @@ which causes it to remain open as the user clicks on different tests.</p>
50
51
  <li><a href="guiCommandLine.html">Command-Line</a></li>
51
52
  <li><a href="mainMenu.html">Main&nbsp;Menu</a></li>
52
53
  <li><a href="contextMenu.html">Context&nbsp;Menu</a></li>
53
- <li><a href="optionsDialog.html">Options&nbsp;Dialog</a></li>
54
+ <li><a href="settingsDialog.html">Settings&nbsp;Dialog</a></li>
54
55
  <li><a href="addinsDialog.html">Addins&nbsp;Dialog</a></li>
55
56
  <li id="current"><a href="testProperties.html">Test&nbsp;Properties</a></li>
56
57
  <li><a href="configEditor.html">Configuration&nbsp;Editor</a></li>
57
58
  <li><a href="projectEditor.html">Project&nbsp;Editor</a></li>
58
59
  </ul>
59
- <li><a href="features.html">Other&nbsp;Features</a></li>
60
+ <li><a href="configFiles.html">Configuration&nbsp;Files</a></li>
61
+ <li><a href="pnunit.html">PNUnit</a></li>
62
+ <li><a href="multiAssembly.html">Multiple&nbsp;Assemblies</a></li>
63
+ <li><a href="vsSupport.html">Visual&nbsp;Studio&nbsp;Support</a></li>
64
+ <li><a href="extensibility.html">Extensibility</a></li>
60
65
  <li><a href="releaseNotes.html">Release&nbsp;Notes</a></li>
61
66
  <li><a href="samples.html">Samples</a></li>
62
67
  <li><a href="license.html">License</a></li>
@@ -68,7 +73,7 @@ which causes it to remain open as the user clicks on different tests.</p>
68
73
 
69
74
  <!-- Standard Footer for NUnit.org -->
70
75
  <div id="footer">
71
- Copyright &copy; 2008 Charlie Poole. All Rights Reserved.
76
+ Copyright &copy; 2009 Charlie Poole. All Rights Reserved.
72
77
  </div>
73
78
  <!-- End of Footer -->
74
79