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.
- data/docs/addinsDialog.html +36 -6
- data/docs/assertions.html +31 -12
- data/docs/attributes.html +59 -36
- data/docs/category.html +32 -9
- data/docs/collectionAssert.html +30 -12
- data/docs/collectionConstraints.html +242 -44
- data/docs/combinatorial.html +130 -0
- data/docs/comparisonAsserts.html +12 -9
- data/docs/comparisonConstraints.html +159 -25
- data/docs/compoundConstraints.html +12 -9
- data/docs/conditionAsserts.html +36 -12
- data/docs/conditionConstraints.html +131 -25
- data/docs/configEditor.html +10 -5
- data/docs/configFiles.html +5 -6
- data/docs/consoleCommandLine.html +51 -24
- data/docs/constraintModel.html +56 -19
- data/docs/contextMenu.html +10 -5
- data/docs/culture.html +32 -9
- data/docs/customConstraints.html +53 -37
- data/docs/datapoint.html +124 -0
- data/docs/datapointProviders.html +105 -0
- data/docs/delayedConstraint.html +98 -0
- data/docs/description.html +32 -9
- data/docs/directoryAssert.html +151 -0
- data/docs/equalConstraint.html +167 -47
- data/docs/equalityAsserts.html +12 -9
- data/docs/eventListeners.html +110 -0
- data/docs/exception.html +61 -36
- data/docs/exceptionAsserts.html +210 -0
- data/docs/explicit.html +32 -9
- data/docs/extensibility.html +8 -8
- data/docs/extensionTips.html +100 -0
- data/docs/fileAssert.html +12 -9
- data/docs/files/TestResult.xml +99 -67
- data/docs/fixtureSetup.html +60 -18
- data/docs/fixtureTeardown.html +56 -17
- data/docs/getStarted.html +9 -4
- data/docs/guiCommandLine.html +10 -5
- data/docs/identityAsserts.html +12 -9
- data/docs/ignore.html +32 -9
- data/docs/img/addinsDialog.JPG +0 -0
- data/docs/img/advancedSettings.jpg +0 -0
- data/docs/img/assembliesTab.jpg +0 -0
- data/docs/img/assemblyReloadSettings.JPG +0 -0
- data/docs/img/configEditor.jpg +0 -0
- data/docs/img/console-mock.jpg +0 -0
- data/docs/img/generalSettings.jpg +0 -0
- data/docs/img/generalTab.jpg +0 -0
- data/docs/img/gui-screenshot.jpg +0 -0
- data/docs/img/gui-verify.jpg +0 -0
- data/docs/img/miniGui.jpg +0 -0
- data/docs/img/testLoadSettings.jpg +0 -0
- data/docs/img/testOutputSettings.jpg +0 -0
- data/docs/img/testProperties.jpg +0 -0
- data/docs/img/testResultSettings.JPG +0 -0
- data/docs/img/textOutputSettings.jpg +0 -0
- data/docs/img/treeDisplaySettings.jpg +0 -0
- data/docs/img/visualStudioSettings.jpg +0 -0
- data/docs/index.html +15 -8
- data/docs/installation.html +33 -75
- data/docs/license.html +9 -4
- data/docs/listMapper.html +12 -9
- data/docs/mainMenu.html +18 -8
- data/docs/maxtime.html +109 -0
- data/docs/multiAssembly.html +5 -6
- data/docs/nunit-console.html +9 -4
- data/docs/nunit-gui.html +32 -15
- data/docs/nunit.css +3 -3
- data/docs/nunitAddins.html +41 -144
- data/docs/pairwise.html +114 -0
- data/docs/parameterizedTests.html +141 -0
- data/docs/pathConstraints.html +162 -0
- data/docs/platform.html +37 -9
- data/docs/pnunit.html +93 -0
- data/docs/projectEditor.html +82 -11
- data/docs/property.html +39 -10
- data/docs/propertyConstraint.html +12 -9
- data/docs/quickStart.html +9 -4
- data/docs/random.html +138 -0
- data/docs/range.html +149 -0
- data/docs/releaseDetail.html +861 -0
- data/docs/releaseNotes.html +457 -1133
- data/docs/repeat.html +104 -0
- data/docs/requiredAddin.html +153 -0
- data/docs/requiresMTA.html +152 -0
- data/docs/requiresSTA.html +153 -0
- data/docs/requiresThread.html +153 -0
- data/docs/sameasConstraint.html +23 -17
- data/docs/samples.html +12 -9
- data/docs/sequential.html +132 -0
- data/docs/setCulture.html +32 -9
- data/docs/{optionsDialog.html → settingsDialog.html} +89 -53
- data/docs/setup.html +61 -16
- data/docs/setupFixture.html +32 -9
- data/docs/stringAssert.html +15 -12
- data/docs/stringConstraints.html +12 -9
- data/docs/suite.html +32 -11
- data/docs/suiteBuilders.html +106 -0
- data/docs/teardown.html +56 -16
- data/docs/test.html +67 -18
- data/docs/testCase.html +168 -0
- data/docs/testCaseSource.html +284 -0
- data/docs/testDecorators.html +117 -0
- data/docs/testFixture.html +228 -16
- data/docs/testProperties.html +10 -5
- data/docs/testcaseBuilders.html +117 -0
- data/docs/testcaseProviders.html +122 -0
- data/docs/theory.html +208 -0
- data/docs/throwsConstraint.html +112 -0
- data/docs/timeout.html +109 -0
- data/docs/typeAsserts.html +47 -14
- data/docs/typeConstraints.html +12 -9
- data/docs/upgrade.html +23 -17
- data/docs/utilityAsserts.html +38 -16
- data/docs/valueSource.html +137 -0
- data/docs/values.html +136 -0
- data/docs/vsSupport.html +5 -6
- data/lib/net-1.1/NUnitTests.config +2 -2
- data/lib/net-1.1/NUnitTests.nunit +8 -11
- data/lib/net-1.1/agent.conf +4 -0
- data/lib/net-1.1/agent.log.conf +18 -0
- data/lib/net-1.1/framework/nunit.framework.dll +0 -0
- data/lib/net-1.1/framework/nunit.framework.xml +9321 -0
- data/lib/net-1.1/framework/nunit.mocks.dll +0 -0
- data/lib/net-1.1/framework/pnunit.framework.dll +0 -0
- data/lib/net-1.1/launcher.log.conf +18 -0
- data/lib/net-1.1/{fit.dll → lib/fit.dll} +0 -0
- data/lib/net-1.1/lib/log4net.dll +0 -0
- data/lib/net-1.1/lib/nunit-console-runner.dll +0 -0
- data/lib/net-1.1/lib/nunit.core.dll +0 -0
- data/lib/net-1.1/lib/nunit.core.interfaces.dll +0 -0
- data/lib/net-1.1/lib/nunit.fixtures.dll +0 -0
- data/lib/net-1.1/lib/nunit.util.dll +0 -0
- data/lib/net-1.1/nunit-agent.exe +0 -0
- data/lib/net-1.1/{nunit.exe.config → nunit-agent.exe.config} +21 -55
- data/lib/net-1.1/nunit-console.exe +0 -0
- data/lib/net-1.1/nunit-console.exe.config +19 -49
- data/lib/net-1.1/nunit.framework.dll +0 -0
- data/lib/net-1.1/pnunit-agent.exe +0 -0
- data/lib/net-1.1/pnunit-agent.exe.config +87 -0
- data/lib/net-1.1/pnunit-launcher.exe +0 -0
- data/lib/net-1.1/pnunit-launcher.exe.config +87 -0
- data/lib/net-1.1/pnunit.framework.dll +0 -0
- data/lib/net-1.1/pnunit.tests.dll +0 -0
- data/lib/net-1.1/runpnunit.bat +2 -0
- data/lib/net-1.1/test.conf +24 -0
- data/lib/net-1.1/{loadtest-assembly.dll → tests/loadtest-assembly.dll} +0 -0
- data/lib/net-1.1/tests/mock-assembly.dll +0 -0
- data/lib/net-1.1/tests/nonamespace-assembly.dll +0 -0
- data/lib/net-1.1/tests/nunit-console.tests.dll +0 -0
- data/lib/net-1.1/tests/nunit.core.tests.dll +0 -0
- data/lib/net-1.1/tests/nunit.fixtures.tests.dll +0 -0
- data/lib/net-1.1/tests/nunit.framework.dll +0 -0
- data/lib/net-1.1/tests/nunit.framework.tests.dll +0 -0
- data/lib/net-1.1/tests/nunit.mocks.tests.dll +0 -0
- data/lib/net-1.1/{nunit.util.tests.dll → tests/nunit.util.tests.dll} +0 -0
- data/lib/net-1.1/tests/test-assembly.dll +0 -0
- data/lib/net-1.1/tests/test-utilities.dll +0 -0
- data/lib/net-1.1/tests/timing-tests.dll +0 -0
- data/lib/net-2.0/NUnitTests.config +2 -2
- data/lib/net-2.0/NUnitTests.nunit +11 -11
- data/lib/net-2.0/agent.conf +4 -0
- data/lib/net-2.0/agent.log.conf +18 -0
- data/lib/net-2.0/framework/nunit.framework.dll +0 -0
- data/lib/net-2.0/framework/nunit.framework.xml +9803 -0
- data/lib/net-2.0/framework/nunit.mocks.dll +0 -0
- data/lib/net-2.0/framework/pnunit.framework.dll +0 -0
- data/lib/net-2.0/launcher.log.conf +18 -0
- data/lib/{net-1.1 → net-2.0/lib}/Failure.jpg +0 -0
- data/lib/net-2.0/{Success.jpg → lib/Gray.jpg} +0 -0
- data/lib/{net-1.1 → net-2.0/lib}/Ignored.jpg +0 -0
- data/lib/{net-1.1 → net-2.0/lib}/Success.jpg +0 -0
- data/lib/net-2.0/{fit.dll → lib/fit.dll} +0 -0
- data/lib/net-2.0/lib/log4net.dll +0 -0
- data/lib/net-2.0/lib/nunit-console-runner.dll +0 -0
- data/lib/net-2.0/lib/nunit-gui-runner.dll +0 -0
- data/lib/net-2.0/lib/nunit.core.dll +0 -0
- data/lib/net-2.0/lib/nunit.core.interfaces.dll +0 -0
- data/lib/net-2.0/lib/nunit.fixtures.dll +0 -0
- data/lib/net-2.0/lib/nunit.uiexception.dll +0 -0
- data/lib/net-2.0/lib/nunit.uikit.dll +0 -0
- data/lib/net-2.0/lib/nunit.util.dll +0 -0
- data/lib/net-2.0/nunit-agent.exe +0 -0
- data/lib/net-2.0/nunit-agent.exe.config +87 -0
- data/lib/net-2.0/nunit-console-x86.exe +0 -0
- data/lib/net-2.0/nunit-console-x86.exe.config +19 -49
- data/lib/net-2.0/nunit-console.exe +0 -0
- data/lib/net-2.0/nunit-console.exe.config +19 -49
- data/lib/net-2.0/nunit-x86.exe +0 -0
- data/lib/net-2.0/nunit-x86.exe.config +48 -74
- data/lib/net-2.0/nunit.exe +0 -0
- data/lib/net-2.0/nunit.exe.config +48 -74
- data/lib/net-2.0/nunit.framework.dll +0 -0
- data/lib/net-2.0/pnunit-agent.exe +0 -0
- data/lib/net-2.0/pnunit-agent.exe.config +87 -0
- data/lib/net-2.0/pnunit-launcher.exe +0 -0
- data/lib/net-2.0/pnunit-launcher.exe.config +87 -0
- data/lib/net-2.0/pnunit.framework.dll +0 -0
- data/lib/net-2.0/pnunit.tests.dll +0 -0
- data/lib/net-2.0/runpnunit.bat +2 -0
- data/lib/net-2.0/test.conf +24 -0
- data/lib/net-2.0/{loadtest-assembly.dll → tests/loadtest-assembly.dll} +0 -0
- data/lib/net-2.0/tests/mock-assembly.dll +0 -0
- data/lib/net-2.0/tests/nonamespace-assembly.dll +0 -0
- data/lib/net-2.0/tests/nunit-console.tests.dll +0 -0
- data/lib/net-2.0/tests/nunit-gui.tests.dll +0 -0
- data/lib/net-2.0/tests/nunit.core.tests.dll +0 -0
- data/lib/net-2.0/tests/nunit.fixtures.tests.dll +0 -0
- data/lib/net-2.0/tests/nunit.framework.dll +0 -0
- data/lib/net-2.0/tests/nunit.framework.tests.dll +0 -0
- data/lib/net-2.0/tests/nunit.mocks.tests.dll +0 -0
- data/lib/net-2.0/tests/nunit.uiexception.tests.dll +0 -0
- data/lib/net-2.0/tests/nunit.uikit.tests.dll +0 -0
- data/lib/net-2.0/{nunit.util.tests.dll → tests/nunit.util.tests.dll} +0 -0
- data/lib/net-2.0/tests/test-assembly.dll +0 -0
- data/lib/net-2.0/tests/test-utilities.dll +0 -0
- data/lib/net-2.0/tests/timing-tests.dll +0 -0
- metadata +131 -74
- data/docs/classicModel.html +0 -92
- data/docs/customAsserts.html +0 -115
- data/docs/features.html +0 -75
- data/docs/files/Thumbs.db +0 -0
- data/docs/platformSupport.html +0 -99
- data/lib/net-1.1/mock-assembly.dll +0 -0
- data/lib/net-1.1/nonamespace-assembly.dll +0 -0
- data/lib/net-1.1/notestfixtures-assembly.dll +0 -0
- data/lib/net-1.1/nunit-console-runner.dll +0 -0
- data/lib/net-1.1/nunit-console.tests.dll +0 -0
- data/lib/net-1.1/nunit-gui-runner.dll +0 -0
- data/lib/net-1.1/nunit-gui.tests.dll +0 -0
- data/lib/net-1.1/nunit.core.dll +0 -0
- data/lib/net-1.1/nunit.core.extensions.dll +0 -0
- data/lib/net-1.1/nunit.core.interfaces.dll +0 -0
- data/lib/net-1.1/nunit.core.tests.dll +0 -0
- data/lib/net-1.1/nunit.exe +0 -0
- data/lib/net-1.1/nunit.extensions.tests.dll +0 -0
- data/lib/net-1.1/nunit.fixtures.dll +0 -0
- data/lib/net-1.1/nunit.fixtures.tests.dll +0 -0
- data/lib/net-1.1/nunit.framework.extensions.dll +0 -0
- data/lib/net-1.1/nunit.framework.tests.dll +0 -0
- data/lib/net-1.1/nunit.framework.xml +0 -5622
- data/lib/net-1.1/nunit.mocks.dll +0 -0
- data/lib/net-1.1/nunit.mocks.tests.dll +0 -0
- data/lib/net-1.1/nunit.uikit.dll +0 -0
- data/lib/net-1.1/nunit.uikit.tests.dll +0 -0
- data/lib/net-1.1/nunit.util.dll +0 -0
- data/lib/net-1.1/test-assembly.dll +0 -0
- data/lib/net-1.1/test-utilities.dll +0 -0
- data/lib/net-1.1/timing-tests.dll +0 -0
- data/lib/net-2.0/Failure.jpg +0 -0
- data/lib/net-2.0/Ignored.jpg +0 -0
- data/lib/net-2.0/mock-assembly.dll +0 -0
- data/lib/net-2.0/nonamespace-assembly.dll +0 -0
- data/lib/net-2.0/notestfixtures-assembly.dll +0 -0
- data/lib/net-2.0/nunit-console-runner.dll +0 -0
- data/lib/net-2.0/nunit-console.tests.dll +0 -0
- data/lib/net-2.0/nunit-gui-runner.dll +0 -0
- data/lib/net-2.0/nunit-gui.tests.dll +0 -0
- data/lib/net-2.0/nunit.core.dll +0 -0
- data/lib/net-2.0/nunit.core.extensions.dll +0 -0
- data/lib/net-2.0/nunit.core.interfaces.dll +0 -0
- data/lib/net-2.0/nunit.core.tests.dll +0 -0
- data/lib/net-2.0/nunit.extensions.tests.dll +0 -0
- data/lib/net-2.0/nunit.fixtures.dll +0 -0
- data/lib/net-2.0/nunit.fixtures.tests.dll +0 -0
- data/lib/net-2.0/nunit.framework.extensions.dll +0 -0
- data/lib/net-2.0/nunit.framework.tests.dll +0 -0
- data/lib/net-2.0/nunit.framework.xml +0 -5622
- data/lib/net-2.0/nunit.mocks.dll +0 -0
- data/lib/net-2.0/nunit.mocks.tests.dll +0 -0
- data/lib/net-2.0/nunit.uikit.dll +0 -0
- data/lib/net-2.0/nunit.uikit.tests.dll +0 -0
- data/lib/net-2.0/nunit.util.dll +0 -0
- data/lib/net-2.0/test-assembly.dll +0 -0
- data/lib/net-2.0/test-utilities.dll +0 -0
- 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 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 Runner</a></li>
|
70
|
+
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
71
|
+
<li><a href="configFiles.html">Configuration Files</a></li>
|
72
|
+
<li><a href="pnunit.html">PNUnit</a></li>
|
73
|
+
<li><a href="multiAssembly.html">Multiple Assemblies</a></li>
|
74
|
+
<li><a href="vsSupport.html">Visual Studio Support</a></li>
|
75
|
+
<li><a href="extensibility.html">Extensibility</a></li>
|
76
|
+
<ul>
|
77
|
+
<li><a href="customConstraints.html">Custom Constraints</a></li>
|
78
|
+
<li><a href="nunitAddins.html">NUnit 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 for Extenders</a></li>
|
88
|
+
</ul>
|
89
|
+
<li><a href="releaseNotes.html">Release 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 © 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 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 Constraint</a></li>
|
61
|
+
<li><a href="sameasConstraint.html">SameAs Constraint</a></li>
|
62
|
+
<li><a href="conditionConstraints.html">Condition Constraints</a></li>
|
63
|
+
<li><a href="comparisonConstraints.html">Comparison Constrants</a></li>
|
64
|
+
<li><a href="pathConstraints.html">Path Constraints</a></li>
|
65
|
+
<li><a href="typeConstraints.html">Type Constraints</a></li>
|
66
|
+
<li><a href="stringConstraints.html">String Constraints</a></li>
|
67
|
+
<li><a href="collectionConstraints.html">Collection Constraints</a></li>
|
68
|
+
<li><a href="propertyConstraint.html">Property Constraint</a></li>
|
69
|
+
<li><a href="throwsConstraint.html">Throws Constraint</a></li>
|
70
|
+
<li><a href="compoundConstraints.html">Compound Constraints</a></li>
|
71
|
+
<li id="current"><a href="delayedConstraint.html">Delayed Constraint</a></li>
|
72
|
+
<li><a href="listMapper.html">List Mapper</a></li>
|
73
|
+
</ul>
|
74
|
+
<li><a href="attributes.html">Attributes</a></li>
|
75
|
+
<li><a href="nunit-console.html">Console Runner</a></li>
|
76
|
+
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
77
|
+
<li><a href="configFiles.html">Configuration Files</a></li>
|
78
|
+
<li><a href="pnunit.html">PNUnit</a></li>
|
79
|
+
<li><a href="multiAssembly.html">Multiple Assemblies</a></li>
|
80
|
+
<li><a href="vsSupport.html">Visual Studio Support</a></li>
|
81
|
+
<li><a href="extensibility.html">Extensibility</a></li>
|
82
|
+
<li><a href="releaseNotes.html">Release 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 © 2009 Charlie Poole. All Rights Reserved.
|
94
|
+
</div>
|
95
|
+
<!-- End of Footer -->
|
96
|
+
|
97
|
+
</body>
|
98
|
+
</html>
|
data/docs/description.html
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
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.
|
135
|
+
<li><a href="index.html">NUnit 2.5</a></li>
|
136
136
|
<ul>
|
137
137
|
<li><a href="getStarted.html">Getting 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">
|
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 MTA</a></li>
|
159
|
+
<li><a href="requiresSTA.html">Requires STA</a></li>
|
160
|
+
<li><a href="requiresThread.html">Requires 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">
|
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="
|
156
|
-
<li><a href="
|
157
|
-
<li><a href="
|
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 Runner</a></li>
|
160
179
|
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
161
|
-
<li><a href="
|
180
|
+
<li><a href="configFiles.html">Configuration Files</a></li>
|
181
|
+
<li><a href="pnunit.html">PNUnit</a></li>
|
182
|
+
<li><a href="multiAssembly.html">Multiple Assemblies</a></li>
|
183
|
+
<li><a href="vsSupport.html">Visual Studio Support</a></li>
|
184
|
+
<li><a href="extensibility.html">Extensibility</a></li>
|
162
185
|
<li><a href="releaseNotes.html">Release 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 ©
|
196
|
+
Copyright © 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 Started</a></li>
|
112
|
+
<li><a href="assertions.html">Assertions</a></li>
|
113
|
+
<ul>
|
114
|
+
<li><a href="equalityAsserts.html">Equality Asserts</a></li>
|
115
|
+
<li><a href="identityAsserts.html">Identity Asserts</a></li>
|
116
|
+
<li><a href="conditionAsserts.html">Condition Asserts</a></li>
|
117
|
+
<li><a href="comparisonAsserts.html">Comparison Asserts</a></li>
|
118
|
+
<li><a href="typeAsserts.html">Type Asserts</a></li>
|
119
|
+
<li><a href="exceptionAsserts.html">Exception Asserts</a></li>
|
120
|
+
<li><a href="utilityAsserts.html">Utility Methods</a></li>
|
121
|
+
<li><a href="stringAssert.html">String Assert</a></li>
|
122
|
+
<li><a href="collectionAssert.html">Collection Assert</a></li>
|
123
|
+
<li><a href="fileAssert.html">File Assert</a></li>
|
124
|
+
<li id="current"><a href="directoryAssert.html">Directory 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 Runner</a></li>
|
129
|
+
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
130
|
+
<li><a href="configFiles.html">Configuration Files</a></li>
|
131
|
+
<li><a href="pnunit.html">PNUnit</a></li>
|
132
|
+
<li><a href="multiAssembly.html">Multiple Assemblies</a></li>
|
133
|
+
<li><a href="vsSupport.html">Visual Studio Support</a></li>
|
134
|
+
<li><a href="extensibility.html">Extensibility</a></li>
|
135
|
+
<li><a href="releaseNotes.html">Release 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 © 2009 Charlie Poole. All Rights Reserved.
|
147
|
+
</div>
|
148
|
+
<!-- End of Footer -->
|
149
|
+
|
150
|
+
</body>
|
151
|
+
</html>
|
data/docs/equalConstraint.html
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
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
|
-
<
|
33
|
-
<
|
34
|
-
|
35
|
-
</
|
33
|
+
<h4>Constructor</h4>
|
34
|
+
<div class="code"><pre>
|
35
|
+
EqualConstraint(object expected )
|
36
|
+
</pre></div>
|
36
37
|
|
37
|
-
<h4>
|
38
|
-
<
|
39
|
-
|
40
|
-
|
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>
|
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<T> comparer)
|
59
|
+
...Using(IComparer comparer)
|
60
|
+
...Using<T>(IComparer<T> comparer)
|
61
|
+
...Using<T>(Comparison<T> 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"
|
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 ) );
|
80
|
-
Assert.That( array2x2, Is.EqualTo( array4 ).AsCollection );
|
156
|
+
Assert.That( array2x2, Is.Not.EqualTo( array4 ) );
|
157
|
+
Assert.That( array2x2, Is.EqualTo( array4 ).AsCollection );
|
158
|
+
</pre></div>
|
81
159
|
|
82
|
-
|
160
|
+
<h4>User-Specified Comparers</h4>
|
83
161
|
|
84
|
-
|
85
|
-
|
86
|
-
|
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<T></b>,
|
166
|
+
<b>IComparer</b>, <b>IComparer<T></b>; or <b>Comparison<T></b>
|
167
|
+
as the argument to <b>Using</b>.
|
87
168
|
|
88
|
-
|
89
|
-
|
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.
|
215
|
+
<li><a href="index.html">NUnit 2.5</a></li>
|
99
216
|
<ul>
|
100
217
|
<li><a href="getStarted.html">Getting Started</a></li>
|
101
218
|
<li><a href="assertions.html">Assertions</a></li>
|
102
|
-
<
|
103
|
-
<li><a href="classicModel.html">Classic Model</a></li>
|
104
|
-
<li><a href="constraintModel.html">Constraint 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 Constraint</a></li>
|
107
222
|
<li><a href="sameasConstraint.html">SameAs Constraint</a></li>
|
108
223
|
<li><a href="conditionConstraints.html">Condition Constraints</a></li>
|
109
224
|
<li><a href="comparisonConstraints.html">Comparison Constrants</a></li>
|
225
|
+
<li><a href="pathConstraints.html">Path Constraints</a></li>
|
110
226
|
<li><a href="typeConstraints.html">Type Constraints</a></li>
|
111
227
|
<li><a href="stringConstraints.html">String Constraints</a></li>
|
112
228
|
<li><a href="collectionConstraints.html">Collection Constraints</a></li>
|
113
229
|
<li><a href="propertyConstraint.html">Property Constraint</a></li>
|
230
|
+
<li><a href="throwsConstraint.html">Throws Constraint</a></li>
|
114
231
|
<li><a href="compoundConstraints.html">Compound Constraints</a></li>
|
115
|
-
<li><a href="
|
232
|
+
<li><a href="delayedConstraint.html">Delayed Constraint</a></li>
|
116
233
|
<li><a href="listMapper.html">List 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 Runner</a></li>
|
121
237
|
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
122
|
-
<li><a href="
|
238
|
+
<li><a href="configFiles.html">Configuration Files</a></li>
|
239
|
+
<li><a href="pnunit.html">PNUnit</a></li>
|
240
|
+
<li><a href="multiAssembly.html">Multiple Assemblies</a></li>
|
241
|
+
<li><a href="vsSupport.html">Visual Studio Support</a></li>
|
242
|
+
<li><a href="extensibility.html">Extensibility</a></li>
|
123
243
|
<li><a href="releaseNotes.html">Release 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 ©
|
254
|
+
Copyright © 2009 Charlie Poole. All Rights Reserved.
|
135
255
|
</div>
|
136
256
|
<!-- End of Footer -->
|
137
257
|
|