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,105 @@
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 - DatapointProviders</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>DataPointProviders (NUnit 2.5)</h3>
28
+
29
+ <h4>Purpose</h4>
30
+ <p>DataPointProviders are used to supply data for an individual parameter
31
+ of a parameterized test method.
32
+
33
+ <h4>Extension Point</h4>
34
+ <p>Addins use the host to access this extension point by name:
35
+
36
+ <pre>
37
+ IExtensionPoint listeners = host.GetExtensionPoint( "DataPointProviders" );</pre>
38
+
39
+ <h4>Interface</h4>
40
+ <p>The extension object passed to Install must implement the IDataPointProvider interface:
41
+
42
+ <pre>
43
+ public interface IDataPointProvider
44
+ {
45
+ bool HasDataFor( ParameterInfo parameter );
46
+ IEnumerable GetDataFor( ParameterInfo parameter );
47
+ }
48
+ </pre>
49
+
50
+ <p>The HasDataFor method should return true if the provider is able to
51
+ supply data for the specified parameter. If a provider only wants to be used
52
+ on certain types of tests, it can examine the supplied ParameterInfo and
53
+ its associated MethodInfo and Type.
54
+
55
+ <p>The GetDataFor method should return a list of individual values to
56
+ use for the supplied parameter in running the test.
57
+
58
+ </div>
59
+
60
+ <!-- Submenu -->
61
+ <div id="subnav">
62
+ <ul>
63
+ <li><a href="index.html">NUnit 2.5</a></li>
64
+ <ul>
65
+ <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
66
+ <li><a href="assertions.html">Assertions</a></li>
67
+ <li><a href="constraintModel.html">Constraints</a></li>
68
+ <li><a href="attributes.html">Attributes</a></li>
69
+ <li><a href="nunit-console.html">Console&nbsp;Runner</a></li>
70
+ <li><a href="nunit-gui.html">Gui&nbsp;Runner</a></li>
71
+ <li><a href="configFiles.html">Configuration&nbsp;Files</a></li>
72
+ <li><a href="pnunit.html">PNUnit</a></li>
73
+ <li><a href="multiAssembly.html">Multiple&nbsp;Assemblies</a></li>
74
+ <li><a href="vsSupport.html">Visual&nbsp;Studio&nbsp;Support</a></li>
75
+ <li><a href="extensibility.html">Extensibility</a></li>
76
+ <ul>
77
+ <li><a href="customConstraints.html">Custom&nbsp;Constraints</a></li>
78
+ <li><a href="nunitAddins.html">NUnit&nbsp;Addins</a></li>
79
+ <ul>
80
+ <li><a href="suiteBuilders.html">SuiteBuilders</a></li>
81
+ <li><a href="testcaseBuilders.html">TestcaseBuilders</a></li>
82
+ <li><a href="testDecorators.html">TestDecorators</a></li>
83
+ <li><a href="testcaseProviders.html">TestcaseProviders</a></li>
84
+ <li id="current"><a href="datapointProviders.html">DatapointProviders</a></li>
85
+ <li><a href="eventListeners.html">EventListeners</a></li>
86
+ </ul>
87
+ <li><a href="extensionTips.html">Tips&nbsp;for&nbsp;Extenders</a></li>
88
+ </ul>
89
+ <li><a href="releaseNotes.html">Release&nbsp;Notes</a></li>
90
+ <li><a href="samples.html">Samples</a></li>
91
+ <li><a href="license.html">License</a></li>
92
+ </ul>
93
+ </ul>
94
+ </div>
95
+ <!-- End of Submenu -->
96
+
97
+
98
+ <!-- Standard Footer for NUnit.org -->
99
+ <div id="footer">
100
+ Copyright &copy; 2009 Charlie Poole. All Rights Reserved.
101
+ </div>
102
+ <!-- End of Footer -->
103
+
104
+ </body>
105
+ </html>
@@ -0,0 +1,98 @@
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 - DelayedConstraint</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>Delayed Constraint (NUnit 2.5)</h2>
28
+
29
+ <p><b>DelayedConstraint</b> delays the application of another constraint until a certain
30
+ amount of time has passed. In it's simplest form, it replaces use of a Sleep
31
+ in the code but it also supports polling, which may allow use of a longer
32
+ maximum time while still keeping the tests as fast as possible.
33
+
34
+ <p>The <b>After</b> modifier is permitted on any constraint, and the delay applies to
35
+ the entire expression up to the point where <b>After</b> appears.
36
+
37
+ <p>Use of a <b>DelayedConstraint</b> with a value argument makes no sense, since
38
+ the value will be extracted at the point of call. It's intended use is with
39
+ delegates and references. If a delegate is used with polling, it may be called
40
+ multiple times so only methods without side effects should be used in this way.
41
+
42
+ <table class="constraints">
43
+ <tr><th>Syntax Helper</th><th>Constructor</th><th>Operation</th></tr>
44
+ <tr><td>After(int)</td><td>DelayedConstraint(Constraint, int)</td></td><td>tests that a constraint is satisfied after a delay.</tr>
45
+ <tr><td>After(int, int)</td><td>DelayedConstraint(Constraint, int, int)</td></td><td>tests that a constraint is satisfied after a delay using polling.</tr>
46
+ </table>
47
+
48
+
49
+ </div>
50
+
51
+ <!-- Submenu -->
52
+ <div id="subnav">
53
+ <ul>
54
+ <li><a href="index.html">NUnit 2.5</a></li>
55
+ <ul>
56
+ <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
57
+ <li><a href="assertions.html">Assertions</a></li>
58
+ <li><a href="constraintModel.html">Constraints</a></li>
59
+ <ul>
60
+ <li><a href="equalConstraint.html">Equal&nbsp;Constraint</a></li>
61
+ <li><a href="sameasConstraint.html">SameAs&nbsp;Constraint</a></li>
62
+ <li><a href="conditionConstraints.html">Condition&nbsp;Constraints</a></li>
63
+ <li><a href="comparisonConstraints.html">Comparison&nbsp;Constrants</a></li>
64
+ <li><a href="pathConstraints.html">Path&nbsp;Constraints</a></li>
65
+ <li><a href="typeConstraints.html">Type&nbsp;Constraints</a></li>
66
+ <li><a href="stringConstraints.html">String&nbsp;Constraints</a></li>
67
+ <li><a href="collectionConstraints.html">Collection&nbsp;Constraints</a></li>
68
+ <li><a href="propertyConstraint.html">Property&nbsp;Constraint</a></li>
69
+ <li><a href="throwsConstraint.html">Throws&nbsp;Constraint</a></li>
70
+ <li><a href="compoundConstraints.html">Compound&nbsp;Constraints</a></li>
71
+ <li id="current"><a href="delayedConstraint.html">Delayed&nbsp;Constraint</a></li>
72
+ <li><a href="listMapper.html">List&nbsp;Mapper</a></li>
73
+ </ul>
74
+ <li><a href="attributes.html">Attributes</a></li>
75
+ <li><a href="nunit-console.html">Console&nbsp;Runner</a></li>
76
+ <li><a href="nunit-gui.html">Gui&nbsp;Runner</a></li>
77
+ <li><a href="configFiles.html">Configuration&nbsp;Files</a></li>
78
+ <li><a href="pnunit.html">PNUnit</a></li>
79
+ <li><a href="multiAssembly.html">Multiple&nbsp;Assemblies</a></li>
80
+ <li><a href="vsSupport.html">Visual&nbsp;Studio&nbsp;Support</a></li>
81
+ <li><a href="extensibility.html">Extensibility</a></li>
82
+ <li><a href="releaseNotes.html">Release&nbsp;Notes</a></li>
83
+ <li><a href="samples.html">Samples</a></li>
84
+ <li><a href="license.html">License</a></li>
85
+ </ul>
86
+ </ul>
87
+ </div>
88
+ <!-- End of Submenu -->
89
+
90
+
91
+ <!-- Standard Footer for NUnit.org -->
92
+ <div id="footer">
93
+ Copyright &copy; 2009 Charlie Poole. All Rights Reserved.
94
+ </div>
95
+ <!-- End of Footer -->
96
+
97
+ </body>
98
+ </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>
@@ -132,33 +132,56 @@ new applciations. If both are used, the Description attribute takes precedence.<
132
132
  <!-- Submenu -->
133
133
  <div id="subnav">
134
134
  <ul>
135
- <li><a href="index.html">NUnit 2.4.8</a></li>
135
+ <li><a href="index.html">NUnit 2.5</a></li>
136
136
  <ul>
137
137
  <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
138
138
  <li><a href="assertions.html">Assertions</a></li>
139
+ <li><a href="constraintModel.html">Constraints</a></li>
139
140
  <li><a href="attributes.html">Attributes</a></li>
140
141
  <ul>
141
142
  <li><a href="category.html">Category</a></li>
143
+ <li><a href="combinatorial.html">Combinatorial</a></li>
142
144
  <li><a href="culture.html">Culture</a></li>
145
+ <li><a href="datapoint.html">Datapoint(s)</a></li>
143
146
  <li id="current"><a href="description.html">Description</a></li>
144
- <li><a href="exception.html">Expected&nbsp;Exception</a></li>
147
+ <li><a href="exception.html">Exception</a></li>
145
148
  <li><a href="explicit.html">Explicit</a></li>
146
149
  <li><a href="ignore.html">Ignore</a></li>
150
+ <li><a href="maxtime.html">Maxtime</a></li>
151
+ <li><a href="pairwise.html">Pairwise</a></li>
147
152
  <li><a href="platform.html">Platform</a></li>
148
153
  <li><a href="property.html">Property</a></li>
154
+ <li><a href="random.html">Random</a></li>
155
+ <li><a href="range.html">Range</a></li>
156
+ <li><a href="repeat.html">Repeat</a></li>
157
+ <li><a href="requiredAddin.html">RequiredAddin</a></li>
158
+ <li><a href="requiresMTA.html">Requires&nbsp;MTA</a></li>
159
+ <li><a href="requiresSTA.html">Requires&nbsp;STA</a></li>
160
+ <li><a href="requiresThread.html">Requires&nbsp;Thread</a></li>
161
+ <li><a href="sequential.html">Sequential</a></li>
149
162
  <li><a href="setCulture.html">SetCulture</a></li>
150
163
  <li><a href="setup.html">Setup</a></li>
151
- <li><a href="setupFixture.html">SetUp&nbsp;Fixture</a></li>
164
+ <li><a href="setupFixture.html">SetupFixture</a></li>
152
165
  <li><a href="suite.html">Suite</a></li>
153
166
  <li><a href="teardown.html">Teardown</a></li>
154
167
  <li><a href="test.html">Test</a></li>
155
- <li><a href="testFixture.html">Test&nbsp;Fixture</a></li>
156
- <li><a href="fixtureSetup.html">Test&nbsp;Fixture&nbsp;SetUp</a></li>
157
- <li><a href="fixtureTeardown.html">Test&nbsp;Fixture&nbsp;TearDown</a></li>
168
+ <li><a href="testCase.html">TestCase</a></li>
169
+ <li><a href="testCaseSource.html">TestCaseSource</a></li>
170
+ <li><a href="testFixture.html">TestFixture</a></li>
171
+ <li><a href="fixtureSetup.html">TestFixtureSetUp</a></li>
172
+ <li><a href="fixtureTeardown.html">TestFixtureTearDown</a></li>
173
+ <li><a href="theory.html">Theory</a></li>
174
+ <li><a href="timeout.html">Timeout</a></li>
175
+ <li><a href="values.html">Values</a></li>
176
+ <li><a href="valueSource.html">ValueSource</a></li>
158
177
  </ul>
159
178
  <li><a href="nunit-console.html">Console&nbsp;Runner</a></li>
160
179
  <li><a href="nunit-gui.html">Gui&nbsp;Runner</a></li>
161
- <li><a href="features.html">Other&nbsp;Features</a></li>
180
+ <li><a href="configFiles.html">Configuration&nbsp;Files</a></li>
181
+ <li><a href="pnunit.html">PNUnit</a></li>
182
+ <li><a href="multiAssembly.html">Multiple&nbsp;Assemblies</a></li>
183
+ <li><a href="vsSupport.html">Visual&nbsp;Studio&nbsp;Support</a></li>
184
+ <li><a href="extensibility.html">Extensibility</a></li>
162
185
  <li><a href="releaseNotes.html">Release&nbsp;Notes</a></li>
163
186
  <li><a href="samples.html">Samples</a></li>
164
187
  <li><a href="license.html">License</a></li>
@@ -170,7 +193,7 @@ new applciations. If both are used, the Description attribute takes precedence.<
170
193
 
171
194
  <!-- Standard Footer for NUnit.org -->
172
195
  <div id="footer">
173
- Copyright &copy; 2008 Charlie Poole. All Rights Reserved.
196
+ Copyright &copy; 2009 Charlie Poole. All Rights Reserved.
174
197
  </div>
175
198
  <!-- End of Footer -->
176
199
 
@@ -0,0 +1,151 @@
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 - DirectoryAssert</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>DirectoryAssert (NUnit 2.5)</h2>
28
+ <p>The DirectoryAssert class provides methods for comparing two directories,
29
+ which may be provided as DirectoryInfos or as strings
30
+ giving the path to each directory.</p>
31
+
32
+ <div class="code" style="width: 40em"><pre>
33
+
34
+ DirectoryAssert.AreEqual( DirectoryInfo expected, DirectoryInfo actual );
35
+ DirectoryAssert.AreEqual( DirectoryInfo expected, DirectoryInfo actual,
36
+ string message );
37
+ DirectoryAssert.AreEqual( DirectoryInfo expected, DirectoryInfo actual,
38
+ string message, params object[] args );
39
+
40
+ DirectoryAssert.AreEqual( string expected, string actual );
41
+ DirectoryAssert.AreEqual( string expected, string actual,
42
+ string message );
43
+ DirectoryAssert.AreEqual( string expected, string actual,
44
+ string message, params object[] args );
45
+
46
+ DirectoryAssert.AreNotEqual( DirectoryInfo expected, DirectoryInfo actual );
47
+ DirectoryAssert.AreNotEqual( DirectoryInfo expected, DirectoryInfo actual,
48
+ string message );
49
+ DirectoryAssert.AreNotEqual( DirectoryInfo expected, DirectoryInfo actual,
50
+ string message, params object[] args );
51
+
52
+ DirectoryAssert.AreNotEqual( string expected, string actual );
53
+ DirectoryAssert.AreNotEqual( string expected, string actual,
54
+ string message );
55
+ DirectoryAssert.AreNotEqual( string expected, string actual,
56
+ string message, params object[] args );
57
+
58
+ DirectoryAssert.IsEmpty( DirectoryInfo directory );
59
+ DirectoryAssert.IsEmpty( DirectoryInfo directory, string message );
60
+ DirectoryAssert.IsEmpty( DirectoryInfo directory,
61
+ string message, params object[] args );
62
+
63
+ DirectoryAssert.IsEmpty( string directory );
64
+ DirectoryAssert.IsEmpty( string directory, string message );
65
+ DirectoryAssert.IsEmpty( string directory,
66
+ string message, params object[] args );
67
+
68
+ DirectoryAssert.IsNotEmpty( DirectoryInfo directory );
69
+ DirectoryAssert.IsNotEmpty( DirectoryInfo directory, string message );
70
+ DirectoryAssert.IsNotEmpty( DirectoryInfo directory,
71
+ string message, params object[] args );
72
+
73
+ DirectoryAssert.IsNotEmpty( string directory );
74
+ DirectoryAssert.IsNotEmpty( string directory, string message );
75
+ DirectoryAssert.IsNotEmpty( string directory,
76
+ string message, params object[] args );
77
+
78
+ DirectoryAssert.IsWithin( DirectoryInfo expected, DirectoryInfo actual );
79
+ DirectoryAssert.IsWithin( DirectoryInfo expected, DirectoryInfo actual,
80
+ string message );
81
+ DirectoryAssert.IsWithin( DirectoryInfo expected, DirectoryInfo actual,
82
+ string message, params object[] args );
83
+
84
+ DirectoryAssert.IsWithin( string expected, string actual );
85
+ DirectoryAssert.IsWithin( string expected, string actual,
86
+ string message );
87
+ DirectoryAssert.IsWithin( string expected, string actual,
88
+ string message, params object[] args );
89
+
90
+ DirectoryAssert.IsNotWithin( DirectoryInfo expected, DirectoryInfo actual );
91
+ DirectoryAssert.IsNotWithin( DirectoryInfo expected, DirectoryInfo actual,
92
+ string message );
93
+ DirectoryAssert.IsNotWithin( DirectoryInfo expected, DirectoryInfo actual,
94
+ string message, params object[] args );
95
+
96
+ DirectoryAssert.IsNotWithin( string expected, string actual );
97
+ DirectoryAssert.IsNotWithin( string expected, string actual,
98
+ string message );
99
+ DirectoryAssert.IsNotWithin( string expected, string actual,
100
+ string message, params object[] args );
101
+
102
+ </pre></div>
103
+
104
+ </div>
105
+
106
+ <!-- Submenu -->
107
+ <div id="subnav">
108
+ <ul>
109
+ <li><a href="index.html">NUnit 2.5</a></li>
110
+ <ul>
111
+ <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
112
+ <li><a href="assertions.html">Assertions</a></li>
113
+ <ul>
114
+ <li><a href="equalityAsserts.html">Equality&nbsp;Asserts</a></li>
115
+ <li><a href="identityAsserts.html">Identity&nbsp;Asserts</a></li>
116
+ <li><a href="conditionAsserts.html">Condition&nbsp;Asserts</a></li>
117
+ <li><a href="comparisonAsserts.html">Comparison&nbsp;Asserts</a></li>
118
+ <li><a href="typeAsserts.html">Type&nbsp;Asserts</a></li>
119
+ <li><a href="exceptionAsserts.html">Exception&nbsp;Asserts</a></li>
120
+ <li><a href="utilityAsserts.html">Utility&nbsp;Methods</a></li>
121
+ <li><a href="stringAssert.html">String&nbsp;Assert</a></li>
122
+ <li><a href="collectionAssert.html">Collection&nbsp;Assert</a></li>
123
+ <li><a href="fileAssert.html">File&nbsp;Assert</a></li>
124
+ <li id="current"><a href="directoryAssert.html">Directory&nbsp;Assert</a></li>
125
+ </ul>
126
+ <li><a href="constraintModel.html">Constraints</a></li>
127
+ <li><a href="attributes.html">Attributes</a></li>
128
+ <li><a href="nunit-console.html">Console&nbsp;Runner</a></li>
129
+ <li><a href="nunit-gui.html">Gui&nbsp;Runner</a></li>
130
+ <li><a href="configFiles.html">Configuration&nbsp;Files</a></li>
131
+ <li><a href="pnunit.html">PNUnit</a></li>
132
+ <li><a href="multiAssembly.html">Multiple&nbsp;Assemblies</a></li>
133
+ <li><a href="vsSupport.html">Visual&nbsp;Studio&nbsp;Support</a></li>
134
+ <li><a href="extensibility.html">Extensibility</a></li>
135
+ <li><a href="releaseNotes.html">Release&nbsp;Notes</a></li>
136
+ <li><a href="samples.html">Samples</a></li>
137
+ <li><a href="license.html">License</a></li>
138
+ </ul>
139
+ </ul>
140
+ </div>
141
+ <!-- End of Submenu -->
142
+
143
+
144
+ <!-- Standard Footer for NUnit.org -->
145
+ <div id="footer">
146
+ Copyright &copy; 2009 Charlie Poole. All Rights Reserved.
147
+ </div>
148
+ <!-- End of Footer -->
149
+
150
+ </body>
151
+ </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>
@@ -24,50 +24,127 @@
24
24
 
25
25
  <div id="content">
26
26
 
27
- <h2>Equal Constraint (NUnit 2.4)</h2>
27
+ <h2>Equal Constraint (NUnit 2.4 / 2.5)</h2>
28
28
 
29
29
  <p>An EqualConstraint is used to test whether an actual value
30
- is equal to the expected value supplied in its constructor.
30
+ is equal to the expected value supplied in its constructor,
31
+ optionally within a specified tolerance.
31
32
 
32
- <table class="constraints">
33
- <tr><th>Syntax Helper</th><th>Constructor</th><th>Operation</th></tr>
34
- <tr><td>Is.EqualTo( object )</td><td>EqualConstraint( null )</td></td><td>tests that two objects are equal</td></tr>
35
- </table>
33
+ <h4>Constructor</h4>
34
+ <div class="code"><pre>
35
+ EqualConstraint(object expected )
36
+ </pre></div>
36
37
 
37
- <h4>Notes</h4>
38
- <ol>
39
- <li>Numerics of different types compare successfully if their values are equal.
40
- <li>Values of type float and double are normally compared using an additional
41
- argument that indicates a tolerance within which they will be considered
42
- as equal. The <b>Within</b> modifier is used for this purpose. Beginning with
43
- NUnit 2.4.2, a tolerance may be specified for other numeric types as well.
44
- <li>Unlike normal floating point arithmetic, floating NaN comparisons succeed
45
- if both values are NaN. See the note on
46
- <a href="equalityAsserts.html">Equality Asserts</a>.
47
- <li>You may use this constraint to compare arrays with the same number of dimensions,
48
- two collections or an single-dimensioned array and collection. If you want to
49
- treat the arrays being compared as simple collections, use the <b>AsCollection</b>
50
- modifier, which causes the comparison to be made element by element, without
51
- regard for the rank or dimensions of the array. Jagged arrays (arrays of arrays)
52
- are compared recursively and must match in shape exactly for the comparison
53
- to succeed.
54
- <li>In order to assert that two strings are equal ignoring case, use the <b>IgnoreCase</b>
55
- modifier. It may also be used when comparing arrays or collections of strings.
56
- </ol>
38
+ <h4>Syntax</h4>
39
+ <div class="code"><pre>
40
+ Is.EqualTo( object expected )
41
+ </pre></div>
57
42
 
58
- <h4>Examples of Use</h4>
43
+ <h4>Modifiers</h4>
44
+ <div class="code"><pre>
45
+ ...IgnoreCase
46
+ ...AsCollection
47
+ ...NoClip
48
+ ...Within(object tolerance)
49
+ .Ulps
50
+ .Percent
51
+ .Days
52
+ .Hours
53
+ .Minutes
54
+ .Seconds
55
+ .Milliseconds
56
+ .Ticks
57
+ ...Using(IEqualityComparer comparer)
58
+ ...Using(IEqualityComparer&lt;T&gt; comparer)
59
+ ...Using(IComparer comparer)
60
+ ...Using<T>(IComparer&lt;T&gt; comparer)
61
+ ...Using<T>(Comparison&lt;T&gt; comparer)
62
+ </pre></div>
63
+
64
+ <h4>Comparing Numerics</h4>
65
+ <p>Numerics are compared based on their values. Different types
66
+ may be compared successfully if their values are equal.
67
+
68
+ <p>Using the <b>Within</b> modifier, numerics may be tested
69
+ for equality within a fixed or percent tolerance.
59
70
 
60
- <div class="code" style="width: 40em"><pre>
61
- Assert.That(2 + 2, Is.EqualTo(4));
71
+ <div class="code"><pre>
72
+ Assert.That(2 + 2, Is.EqualTo(4.0));
62
73
  Assert.That(2 + 2 == 4);
63
74
  Assert.That(2 + 2, Is.Not.EqualTo(5));
64
75
  Assert.That(2 + 2 != 5);
65
76
  Assert.That( 5.0, Is.EqualTo( 5 );
77
+ Assert.That( 5.5, Is.EqualTo( 5 ).Within(0.075);
78
+ Assert.That( 5.5, Is.EqualTo( 5 ).Within(1.5).Percent;
79
+ </pre></div>
80
+
81
+ <h4>Comparing Floating Point Values</h4>
82
+ <p>Values of type float and double are normally compared using a tolerance
83
+ specified by the <b>Within</b> modifier. The special values PositiveInfinity,
84
+ NegativeInfinity and NaN compare
85
+ as equal to themselves.
86
+
87
+ <p>With version 2.5, floating-point values may be compared using a tolerance
88
+ in "Units in the Last Place" or ULPs. For certain types of numerical work,
89
+ this is safer than a fixed tolerance because it automatically compensates
90
+ for the added inaccuracy of larger numbers.
91
+
92
+ <div class="code" style="width: 42em"><pre>
66
93
  Assert.That( 2.1 + 1.2, Is.EqualTo( 3.3 ).Within( .0005 );
67
94
  Assert.That( double.PositiveInfinity, Is.EqualTo( double.PositiveInfinity ) );
68
95
  Assert.That( double.NegativeInfinity, Is.EqualTo( double.NegativeInfinity ) );
69
96
  Assert.That( double.NaN, Is.EqualTo( double.NaN ) );
97
+ Assert.That( 20000000000000004.0, Is.EqualTo(20000000000000000.0).Within(1).Ulps);
98
+ </pre></div>
99
+
100
+ <h4>Comparing Strings</h4>
101
+
102
+ <p>String comparisons normally respect case. The <b>IgnoreCase</b> modifier
103
+ causes the comparison to be case-insensitive. It may also be used when
104
+ comparing arrays or collections of strings.
105
+
106
+ <div class="code"><pre>
107
+ Assert.That( "Hello!", Is.Not.EqualTo( "HELLO!" ) );
108
+ Assert.That( "Hello!", Is.EqualTo( "HELLO!" ).IgnoreCase );
70
109
 
110
+ string[] expected = new string[] { "Hello", World" };
111
+ string[] actual = new string[] { "HELLO", "world" };
112
+ Assert.That( actual, Is.EqualTo( expected ).IgnoreCase;
113
+ </pre></div>
114
+
115
+ <h4>Comparing DateTimes and TimeSpans</h4>
116
+
117
+ <p><b>DateTimes</b> and <b>TimeSpans</b> may be compared either with or without
118
+ a tolerance. A tolerance is specified using <b>Within</b> with either a
119
+ <b>TimeSpan</b> as an argument or with a numeric value followed by a one of
120
+ the time conversion modifiers: <b>Days</b>, <b>Hours</b>, <b>Minutes</b>,
121
+ <b>Seconds</b>, <b>Milliseconds</b> or <b>Ticks</b>.
122
+
123
+ <div class="code"><pre>
124
+ DateTime now = DateTime.Now;
125
+ DateTime later = now + TimeSpan.FromHours(1.0);
126
+
127
+ Assert.That( now, Is.EqualTo(now) );
128
+ Assert.That( later. Is.EqualTo(now).Within(TimeSpan.FromHours(3.0);
129
+ Assert.That( later, Is.EqualTo(now).Within(3).Hours;
130
+ </pre></div>
131
+
132
+ <h4>Comparing Arrays and Collections</h4>
133
+
134
+ <p>Since version 2.2, NUnit has been able to compare two single-dimensioned arrays.
135
+ Beginning with version 2.4, multi-dimensioned arrays, nested arrays (arrays of arrays)
136
+ and collections may be compared. With version 2.5, any IEnumerable is supported.
137
+ Two arrays, collections or IEnumerables are considered equal if they have the
138
+ the same dimensions and if each of the corresponding elements is equal.</p>
139
+
140
+ <p>If you want to treat two arrays of different shapes as simple collections
141
+ for purposes of comparison, use the <b>AsCollection</b> modifier, which causes
142
+ the comparison to be made element by element, without regard for the rank or
143
+ dimensions of the array. Note that jagged arrays (arrays of arrays) do not
144
+ have a single underlying collection. The modifier would be applied
145
+ to each array separately, which has no effect in most cases.
146
+
147
+ <div class="code"><pre>
71
148
  int[] i3 = new int[] { 1, 2, 3 };
72
149
  double[] d3 = new double[] { 1.0, 2.0, 3.0 };
73
150
  int[] iunequal = new int[] { 1, 3, 2 };
@@ -76,50 +153,93 @@ Assert.That(i3, Is.Not.EqualTo(iunequal));
76
153
 
77
154
  int array2x2 = new int[,] { { 1, 2 } { 3, 4 } };
78
155
  int array4 = new int[] { 1, 2, 3, 4 };
79
- Assert.That( array2x2, Is.EqualTo( array4 ) ); // Fails
80
- Assert.That( array2x2, Is.EqualTo( array4 ).AsCollection ); // Succeeds
156
+ Assert.That( array2x2, Is.Not.EqualTo( array4 ) );
157
+ Assert.That( array2x2, Is.EqualTo( array4 ).AsCollection );
158
+ </pre></div>
81
159
 
82
- Assert.That( "Hello!", Is.EqualTo( "HELLO!" ).IgnoreCase );
160
+ <h4>User-Specified Comparers</h4>
83
161
 
84
- string[] expected = new string[] { "Hello", World" };
85
- string[] actual = new string[] { "HELLO", "world" };
86
- Assert.That( actual, Is.EqualTo( expected ).IgnoreCase;
162
+ <p>If the default NUnit or .NET behavior for testing equality doesn't
163
+ meet your needs, you can supply a comparer of your own through the
164
+ <b>Using</b> modifier. When used with <b>EqualConstraint</b>, you
165
+ may supply an <b>IEqualityComparer</b>, <b>IEqualityComparer&lt;T&gt;</b>,
166
+ <b>IComparer</b>, <b>IComparer&lt;T&gt</b>; or <b>Comparison&lt;T&gt;</b>
167
+ as the argument to <b>Using</b>.
87
168
 
88
- // Using inheritance
89
- Expect( i3, EqualTo( d3 ) );
90
- Expect( i3, Not.EqualTo( iunequal ) );
169
+ <div class="code"><pre>
170
+ Assert.That( myObj1, Is.EqualTo( myObj2 ).Using( myComparer ) );
91
171
  </pre></div>
92
172
 
173
+ <h4>Notes</h4>
174
+ <ol>
175
+ <li><p>When checking the equality of user-defined classes, NUnit makes use
176
+ of the <b>Equals</b> override on the expected object. If you neglect to
177
+ override <b>Equals</b>, you can expect failures non-identical objects.
178
+ In particular, overriding <b>operator==</b> without overriding <b>Equals</b>
179
+ has no effect.
180
+ <li><p>The <b>Within</b> modifier was originally designed for use with floating point
181
+ values only. Beginning with NUnit 2.4, comparisons of <b>DateTime</b> values
182
+ may use a <b>TimeSpan</b> as a tolerance. Beginning with NUnit 2.4.2,
183
+ non-float numeric comparisons may also specify a tolerance.
184
+ <li><p>Beginning with NUnit 2.4.4, float and double comparisons for which no
185
+ tolerance is specified use a default, use the value of
186
+ <b>GlobalSettings.DefaultFloatingPointTolerance</b>. If this is not
187
+ set, a tolerance of 0.0d is used.
188
+ <li><p>Prior to NUnit 2.2.3, comparison of two NaN values would always fail,
189
+ as specified by IEEE floating point standards. The new behavior, was
190
+ introduced after some discussion becuase it seems more useful in tests.
191
+ To avoid confusion, consider using <b>Is.NaN</b> where appropriate.
192
+ <li><p>When an equality test between two strings fails, the relevant portion of
193
+ of both strings is displayed in the error message, clipping the strings to
194
+ fit the length of the line as needed. Beginning with 2.4.4, this behavior
195
+ may be modified by use of the <b>NoClip</b> modifier on the constraint. In
196
+ addition, the maximum line length may be modified for all tests by setting
197
+ the value of <b>TextMessageWriter.MaximumLineLength</b> in the appropriate
198
+ level of setup.
199
+ <li><p>When used with arrays or collections, EqualConstraint operates
200
+ recursively. Any modifiers are saved and used as they apply to
201
+ individual items in the collection.
202
+ <li><p>A user-specified comparer will not be called by <b>EqualConstraint</b>
203
+ if either or both arguments are null. If both are null, the Constraint
204
+ succeeds. If only one is null, it fails.
205
+ <li><p>NUnit has special semantics for comparing <b>Streams</b> and
206
+ <b>DirectoryInfos</b>. For a <b>Stream</b>, the contents are compared.
207
+ For a <b>DirectoryInfo</b>, the first-level directory contents are compared.
208
+ </ol>
209
+
93
210
  </div>
94
211
 
95
212
  <!-- Submenu -->
96
213
  <div id="subnav">
97
214
  <ul>
98
- <li><a href="index.html">NUnit 2.4.8</a></li>
215
+ <li><a href="index.html">NUnit 2.5</a></li>
99
216
  <ul>
100
217
  <li><a href="getStarted.html">Getting&nbsp;Started</a></li>
101
218
  <li><a href="assertions.html">Assertions</a></li>
102
- <ul>
103
- <li><a href="classicModel.html">Classic&nbsp;Model</a></li>
104
- <li><a href="constraintModel.html">Constraint&nbsp;Model</a></li>
219
+ <li><a href="constraintModel.html">Constraints</a></li>
105
220
  <ul>
106
221
  <li id="current"><a href="equalConstraint.html">Equal&nbsp;Constraint</a></li>
107
222
  <li><a href="sameasConstraint.html">SameAs&nbsp;Constraint</a></li>
108
223
  <li><a href="conditionConstraints.html">Condition&nbsp;Constraints</a></li>
109
224
  <li><a href="comparisonConstraints.html">Comparison&nbsp;Constrants</a></li>
225
+ <li><a href="pathConstraints.html">Path&nbsp;Constraints</a></li>
110
226
  <li><a href="typeConstraints.html">Type&nbsp;Constraints</a></li>
111
227
  <li><a href="stringConstraints.html">String&nbsp;Constraints</a></li>
112
228
  <li><a href="collectionConstraints.html">Collection&nbsp;Constraints</a></li>
113
229
  <li><a href="propertyConstraint.html">Property&nbsp;Constraint</a></li>
230
+ <li><a href="throwsConstraint.html">Throws&nbsp;Constraint</a></li>
114
231
  <li><a href="compoundConstraints.html">Compound&nbsp;Constraints</a></li>
115
- <li><a href="customConstraints.html">Custom&nbsp;Constraints</a></li>
232
+ <li><a href="delayedConstraint.html">Delayed&nbsp;Constraint</a></li>
116
233
  <li><a href="listMapper.html">List&nbsp;Mapper</a></li>
117
234
  </ul>
118
- </ul>
119
235
  <li><a href="attributes.html">Attributes</a></li>
120
236
  <li><a href="nunit-console.html">Console&nbsp;Runner</a></li>
121
237
  <li><a href="nunit-gui.html">Gui&nbsp;Runner</a></li>
122
- <li><a href="features.html">Other&nbsp;Features</a></li>
238
+ <li><a href="configFiles.html">Configuration&nbsp;Files</a></li>
239
+ <li><a href="pnunit.html">PNUnit</a></li>
240
+ <li><a href="multiAssembly.html">Multiple&nbsp;Assemblies</a></li>
241
+ <li><a href="vsSupport.html">Visual&nbsp;Studio&nbsp;Support</a></li>
242
+ <li><a href="extensibility.html">Extensibility</a></li>
123
243
  <li><a href="releaseNotes.html">Release&nbsp;Notes</a></li>
124
244
  <li><a href="samples.html">Samples</a></li>
125
245
  <li><a href="license.html">License</a></li>
@@ -131,7 +251,7 @@ Expect( i3, Not.EqualTo( iunequal ) );
131
251
 
132
252
  <!-- Standard Footer for NUnit.org -->
133
253
  <div id="footer">
134
- Copyright &copy; 2008 Charlie Poole. All Rights Reserved.
254
+ Copyright &copy; 2009 Charlie Poole. All Rights Reserved.
135
255
  </div>
136
256
  <!-- End of Footer -->
137
257