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,117 @@
|
|
1
|
+
<!-- saved from url=(0014)about:internet --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
2
|
+
<html>
|
3
|
+
<!-- Standard Head Part -->
|
4
|
+
<head>
|
5
|
+
<title>NUnit - TestcaseBuilders</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>TestCaseBuilders (NUnit 2.4)</h3>
|
28
|
+
|
29
|
+
<h4>Purpose</h4>
|
30
|
+
<p>TestCaseBuilders create Tests based on a MethodInfo. NUnit uses several
|
31
|
+
TestCaseBuilders internally to create various kinds of TestMethods.
|
32
|
+
|
33
|
+
<h4>Extension Point</h4>
|
34
|
+
Addins use the host to access this extension point by name:
|
35
|
+
|
36
|
+
<pre>
|
37
|
+
IExtensionPoint testCaseBuilders = host.GetExtensionPoint( "TestCaseBuilders" );</pre>
|
38
|
+
|
39
|
+
<h4>Interfaces</h4>
|
40
|
+
<p>The extension object passed to Install must implement either the ITestCaseBuilder
|
41
|
+
or the ITestCaseBuilder2 interface:
|
42
|
+
|
43
|
+
<pre>
|
44
|
+
public interface ITestCaseBuilder
|
45
|
+
{
|
46
|
+
bool CanBuildFrom( MethodInfo method );
|
47
|
+
Test BuildFrom( MethodInfo method );
|
48
|
+
}
|
49
|
+
|
50
|
+
public interface ITestCaseBuilder2 : ITestCaseBuilder
|
51
|
+
{
|
52
|
+
bool CanBuildFrom( MethodInfo method, Test suite );
|
53
|
+
Test BuildFrom( MethodInfo method, Test suite );
|
54
|
+
}
|
55
|
+
</pre>
|
56
|
+
|
57
|
+
<p>NUnit will call ITestCaseBuilder2 if it is available. Otherwise
|
58
|
+
ITestCaseBuilder will be used.
|
59
|
+
|
60
|
+
<p>The CanBuildFrom method should return true if the addin can build
|
61
|
+
a test from the MethodInfo provided. Some TestCaseBuilder addins are only
|
62
|
+
intended to apply to methods within a specific type of fixture. The
|
63
|
+
suite argument of the ITestCaseBuilder2 interface may be used to make
|
64
|
+
this determination.
|
65
|
+
|
66
|
+
<p>The BuildFrom method should return a test constructed over the MethodInfo
|
67
|
+
provided as an argument or null if the method cannot be used.
|
68
|
+
|
69
|
+
|
70
|
+
</div>
|
71
|
+
|
72
|
+
<!-- Submenu -->
|
73
|
+
<div id="subnav">
|
74
|
+
<ul>
|
75
|
+
<li><a href="index.html">NUnit 2.5</a></li>
|
76
|
+
<ul>
|
77
|
+
<li><a href="getStarted.html">Getting Started</a></li>
|
78
|
+
<li><a href="assertions.html">Assertions</a></li>
|
79
|
+
<li><a href="constraintModel.html">Constraints</a></li>
|
80
|
+
<li><a href="attributes.html">Attributes</a></li>
|
81
|
+
<li><a href="nunit-console.html">Console Runner</a></li>
|
82
|
+
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
83
|
+
<li><a href="configFiles.html">Configuration Files</a></li>
|
84
|
+
<li><a href="pnunit.html">PNUnit</a></li>
|
85
|
+
<li><a href="multiAssembly.html">Multiple Assemblies</a></li>
|
86
|
+
<li><a href="vsSupport.html">Visual Studio Support</a></li>
|
87
|
+
<li><a href="extensibility.html">Extensibility</a></li>
|
88
|
+
<ul>
|
89
|
+
<li><a href="customConstraints.html">Custom Constraints</a></li>
|
90
|
+
<li><a href="nunitAddins.html">NUnit Addins</a></li>
|
91
|
+
<ul>
|
92
|
+
<li><a href="suiteBuilders.html">SuiteBuilders</a></li>
|
93
|
+
<li id="current"><a href="testcaseBuilders.html">TestcaseBuilders</a></li>
|
94
|
+
<li><a href="testDecorators.html">TestDecorators</a></li>
|
95
|
+
<li><a href="testcaseProviders.html">TestcaseProviders</a></li>
|
96
|
+
<li><a href="datapointProviders.html">DatapointProviders</a></li>
|
97
|
+
<li><a href="eventListeners.html">EventListeners</a></li>
|
98
|
+
</ul>
|
99
|
+
<li><a href="extensionTips.html">Tips for Extenders</a></li>
|
100
|
+
</ul>
|
101
|
+
<li><a href="releaseNotes.html">Release Notes</a></li>
|
102
|
+
<li><a href="samples.html">Samples</a></li>
|
103
|
+
<li><a href="license.html">License</a></li>
|
104
|
+
</ul>
|
105
|
+
</ul>
|
106
|
+
</div>
|
107
|
+
<!-- End of Submenu -->
|
108
|
+
|
109
|
+
|
110
|
+
<!-- Standard Footer for NUnit.org -->
|
111
|
+
<div id="footer">
|
112
|
+
Copyright © 2009 Charlie Poole. All Rights Reserved.
|
113
|
+
</div>
|
114
|
+
<!-- End of Footer -->
|
115
|
+
|
116
|
+
</body>
|
117
|
+
</html>
|
@@ -0,0 +1,122 @@
|
|
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 - TestcaseProviders</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>TestCaseProviders (NUnit 2.5)</h3>
|
28
|
+
|
29
|
+
<h4>Purpose</h4>
|
30
|
+
<p>TestCaseProviders are used with parameterized tests to provide the
|
31
|
+
specific test cases that will be used in calling the test.
|
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( "ParameterProviders" );</pre>
|
38
|
+
|
39
|
+
<h4>Interface</h4>
|
40
|
+
<p>The extension object passed to Install must implement the ITestCaseProvider interface:
|
41
|
+
|
42
|
+
<pre>
|
43
|
+
public interface ITestCaseProvider
|
44
|
+
{
|
45
|
+
bool HasTestCasesFor( MethodInfo method );
|
46
|
+
IEnumerable GetTestCasesFor( MethodInfo method );
|
47
|
+
}
|
48
|
+
</pre>
|
49
|
+
|
50
|
+
<p>HasTestCasesFor returns true if the provider is able to supply test cases
|
51
|
+
for the specified method. If a provider only wants to be used on certain types
|
52
|
+
of tests, it should examine the provided MethodInfo and return true or false
|
53
|
+
based on what it finds.
|
54
|
+
|
55
|
+
<p>The GetParametersFor method should return a list of individual test cases.
|
56
|
+
Each test case may be expressed as a ParameterSet, as an array of arguments
|
57
|
+
or as a custom object containing one or more of the following properties:
|
58
|
+
|
59
|
+
<ul>
|
60
|
+
<li>Arguments
|
61
|
+
<li>RunState
|
62
|
+
<li>NotRunReason
|
63
|
+
<li>ExpectedExceptionType
|
64
|
+
<li>ExpectedExceptionName
|
65
|
+
<li>ExpectedExceptionMessage
|
66
|
+
<li>Result
|
67
|
+
<li>Description
|
68
|
+
<li>TestName
|
69
|
+
</ul>
|
70
|
+
|
71
|
+
<p>The ParameterSet class provides all these properties and may be used
|
72
|
+
to avoid the overhead of reflecting on the properties.
|
73
|
+
|
74
|
+
|
75
|
+
</div>
|
76
|
+
|
77
|
+
<!-- Submenu -->
|
78
|
+
<div id="subnav">
|
79
|
+
<ul>
|
80
|
+
<li><a href="index.html">NUnit 2.5</a></li>
|
81
|
+
<ul>
|
82
|
+
<li><a href="getStarted.html">Getting Started</a></li>
|
83
|
+
<li><a href="assertions.html">Assertions</a></li>
|
84
|
+
<li><a href="constraintModel.html">Constraints</a></li>
|
85
|
+
<li><a href="attributes.html">Attributes</a></li>
|
86
|
+
<li><a href="nunit-console.html">Console Runner</a></li>
|
87
|
+
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
88
|
+
<li><a href="configFiles.html">Configuration Files</a></li>
|
89
|
+
<li><a href="pnunit.html">PNUnit</a></li>
|
90
|
+
<li><a href="multiAssembly.html">Multiple Assemblies</a></li>
|
91
|
+
<li><a href="vsSupport.html">Visual Studio Support</a></li>
|
92
|
+
<li><a href="extensibility.html">Extensibility</a></li>
|
93
|
+
<ul>
|
94
|
+
<li><a href="customConstraints.html">Custom Constraints</a></li>
|
95
|
+
<li><a href="nunitAddins.html">NUnit Addins</a></li>
|
96
|
+
<ul>
|
97
|
+
<li><a href="suiteBuilders.html">SuiteBuilders</a></li>
|
98
|
+
<li><a href="testcaseBuilders.html">TestcaseBuilders</a></li>
|
99
|
+
<li><a href="testDecorators.html">TestDecorators</a></li>
|
100
|
+
<li id="current"><a href="testcaseProviders.html">TestcaseProviders</a></li>
|
101
|
+
<li><a href="datapointProviders.html">DatapointProviders</a></li>
|
102
|
+
<li><a href="eventListeners.html">EventListeners</a></li>
|
103
|
+
</ul>
|
104
|
+
<li><a href="extensionTips.html">Tips for Extenders</a></li>
|
105
|
+
</ul>
|
106
|
+
<li><a href="releaseNotes.html">Release Notes</a></li>
|
107
|
+
<li><a href="samples.html">Samples</a></li>
|
108
|
+
<li><a href="license.html">License</a></li>
|
109
|
+
</ul>
|
110
|
+
</ul>
|
111
|
+
</div>
|
112
|
+
<!-- End of Submenu -->
|
113
|
+
|
114
|
+
|
115
|
+
<!-- Standard Footer for NUnit.org -->
|
116
|
+
<div id="footer">
|
117
|
+
Copyright © 2009 Charlie Poole. All Rights Reserved.
|
118
|
+
</div>
|
119
|
+
<!-- End of Footer -->
|
120
|
+
|
121
|
+
</body>
|
122
|
+
</html>
|
data/docs/theory.html
ADDED
@@ -0,0 +1,208 @@
|
|
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 - Theory</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>TheoryAttribute (NUnit 2.5)</h3>
|
28
|
+
|
29
|
+
<p>A Theory is a special type of test, used to verify a general
|
30
|
+
statement about the system under development. Normal tests are
|
31
|
+
<em>example-based</em>. That is, the developer supplies one or
|
32
|
+
more examples of inputs and expected outputs either within the
|
33
|
+
code of the test or - in the case of
|
34
|
+
<a href="parameterizedTests.html">Parameterized Tests</a>
|
35
|
+
- as arguments to the test method. A theory, on the other hand,
|
36
|
+
makes a general statement that all of its assertions will pass
|
37
|
+
for all arguments satisfying certain assumptions.
|
38
|
+
|
39
|
+
<p>Theories are implemented in NUnit
|
40
|
+
as methods within a <b>TestFixture</b>, which are annotated
|
41
|
+
with the <b>TheoryAttribute</b>. Theory methods must always have
|
42
|
+
arguments and therefore appears quite similar to
|
43
|
+
<a href="parameterizedTests.html">Parameterized Tests</a> at first glance. However, a Theory incorporates additional data sources
|
44
|
+
for its arguments and allows special processing for assumptions
|
45
|
+
about that data. The key difference, though, is that theories
|
46
|
+
make general statements and are more than just a set of examples.
|
47
|
+
|
48
|
+
<h4>Data for Theories</h4>
|
49
|
+
|
50
|
+
<p>The primary source of data for a <b>Theory</b> is the
|
51
|
+
<a href="datapoint.html"><b>Datapoint</b> or <b>Datapoints</b> attribute</a>.
|
52
|
+
NUnit will use any fields of the required types, which are annotated
|
53
|
+
with one of these attributes, to provide data for each parameter
|
54
|
+
of the Theory. NUnit assembles the values for individual arguments
|
55
|
+
combinatorially to provide test cases for the theory.
|
56
|
+
|
57
|
+
<p>In addition to the Datapoint and Datapoints attributes, it
|
58
|
+
is possible to use any of the approaches for supplying data
|
59
|
+
that are recognized on normal parameterized tests. We suggest
|
60
|
+
that this capability not be overused, since it runs counter
|
61
|
+
to the distinction between a test based on examples and a
|
62
|
+
theory. However, it may be useful in order to guarantee that
|
63
|
+
a specific test case is included.
|
64
|
+
|
65
|
+
<h4>Assumptions</h4>
|
66
|
+
|
67
|
+
<p>The theory itself is responsible for ensuring that all data supplied
|
68
|
+
meets its assumptions. It does this by use of the
|
69
|
+
<b>Assume.That(...)</b> construct, which works just like
|
70
|
+
<b>Assert.That(...)</b> but does not cause a failure. If
|
71
|
+
the assumption is not satisfied for a particular test case, that case
|
72
|
+
returns an Inconclusive result, rather than a Success or Failure.
|
73
|
+
|
74
|
+
<p>The overall result of executing a Theory over a set of test cases is
|
75
|
+
determined as follows:
|
76
|
+
|
77
|
+
<ul>
|
78
|
+
<li>If the assumptions are violated for <b>all</b> test cases, then the
|
79
|
+
Theory itself is marked as a failure.
|
80
|
+
|
81
|
+
<li>If any Assertion fails, the Theory itself fails.
|
82
|
+
|
83
|
+
<li>If at least <b>some</b> cases pass the stated assumptions, and
|
84
|
+
there are <b>no</b> assertion failures or exceptions, then the
|
85
|
+
Theory passes.
|
86
|
+
</ul>
|
87
|
+
|
88
|
+
<h4>Example:</h4>
|
89
|
+
|
90
|
+
<p>In the following example, the theory SquareRootDefinition
|
91
|
+
verifies that the implementation of square root satisies
|
92
|
+
the following definition:
|
93
|
+
|
94
|
+
<p style="margin: 2em"><i>
|
95
|
+
"Given a non-negative number, the square root of that number
|
96
|
+
is always non-negative and, when multiplied by itself, gives
|
97
|
+
the original number."</i>
|
98
|
+
|
99
|
+
<div class="code" style="width: 36em">
|
100
|
+
<pre>
|
101
|
+
public class SqrtTests
|
102
|
+
{
|
103
|
+
[Datapoint]
|
104
|
+
public double zero = 0;
|
105
|
+
|
106
|
+
[Datapoint]
|
107
|
+
public double positive = 1;
|
108
|
+
|
109
|
+
[Datapoint]
|
110
|
+
public double negative = -1;
|
111
|
+
|
112
|
+
[Datapoint]
|
113
|
+
public double max = double.MaxValue;
|
114
|
+
|
115
|
+
[Datapoint]
|
116
|
+
public double infinity = double.PositiveInfinity;
|
117
|
+
|
118
|
+
[Theory]
|
119
|
+
public void SquareRootDefinition(double num)
|
120
|
+
{
|
121
|
+
Assume.That(num >= 0.0 && num < double.MaxValue);
|
122
|
+
|
123
|
+
double sqrt = Math.Sqrt(num);
|
124
|
+
|
125
|
+
Assert.That(sqrt >= 0.0);
|
126
|
+
Assert.That(sqrt * sqrt, Is.EqualTo(num).Within(0.000001));
|
127
|
+
}
|
128
|
+
}
|
129
|
+
</pre>
|
130
|
+
</div>
|
131
|
+
|
132
|
+
<h4>See also...</h4>
|
133
|
+
|
134
|
+
<ul>
|
135
|
+
<li><a href="datapoint.html">Datapoint(s)Attribute</a><li><a href="parameterizedTests.html">Parameterized Tests</a></ul>
|
136
|
+
|
137
|
+
</div>
|
138
|
+
|
139
|
+
<!-- Submenu -->
|
140
|
+
<div id="subnav">
|
141
|
+
<ul>
|
142
|
+
<li><a href="index.html">NUnit 2.5</a></li>
|
143
|
+
<ul>
|
144
|
+
<li><a href="getStarted.html">Getting Started</a></li>
|
145
|
+
<li><a href="assertions.html">Assertions</a></li>
|
146
|
+
<li><a href="constraintModel.html">Constraints</a></li>
|
147
|
+
<li><a href="attributes.html">Attributes</a></li>
|
148
|
+
<ul>
|
149
|
+
<li><a href="category.html">Category</a></li>
|
150
|
+
<li><a href="combinatorial.html">Combinatorial</a></li>
|
151
|
+
<li><a href="culture.html">Culture</a></li>
|
152
|
+
<li><a href="datapoint.html">Datapoint(s)</a></li>
|
153
|
+
<li><a href="description.html">Description</a></li>
|
154
|
+
<li><a href="exception.html">Exception</a></li>
|
155
|
+
<li><a href="explicit.html">Explicit</a></li>
|
156
|
+
<li><a href="ignore.html">Ignore</a></li>
|
157
|
+
<li><a href="maxtime.html">Maxtime</a></li>
|
158
|
+
<li><a href="pairwise.html">Pairwise</a></li>
|
159
|
+
<li><a href="platform.html">Platform</a></li>
|
160
|
+
<li><a href="property.html">Property</a></li>
|
161
|
+
<li><a href="random.html">Random</a></li>
|
162
|
+
<li><a href="range.html">Range</a></li>
|
163
|
+
<li><a href="repeat.html">Repeat</a></li>
|
164
|
+
<li><a href="requiredAddin.html">RequiredAddin</a></li>
|
165
|
+
<li><a href="requiresMTA.html">Requires MTA</a></li>
|
166
|
+
<li><a href="requiresSTA.html">Requires STA</a></li>
|
167
|
+
<li><a href="requiresThread.html">Requires Thread</a></li>
|
168
|
+
<li><a href="sequential.html">Sequential</a></li>
|
169
|
+
<li><a href="setCulture.html">SetCulture</a></li>
|
170
|
+
<li><a href="setup.html">Setup</a></li>
|
171
|
+
<li><a href="setupFixture.html">SetupFixture</a></li>
|
172
|
+
<li><a href="suite.html">Suite</a></li>
|
173
|
+
<li><a href="teardown.html">Teardown</a></li>
|
174
|
+
<li><a href="test.html">Test</a></li>
|
175
|
+
<li><a href="testCase.html">TestCase</a></li>
|
176
|
+
<li><a href="testCaseSource.html">TestCaseSource</a></li>
|
177
|
+
<li><a href="testFixture.html">TestFixture</a></li>
|
178
|
+
<li><a href="fixtureSetup.html">TestFixtureSetUp</a></li>
|
179
|
+
<li><a href="fixtureTeardown.html">TestFixtureTearDown</a></li>
|
180
|
+
<li id="current"><a href="theory.html">Theory</a></li>
|
181
|
+
<li><a href="timeout.html">Timeout</a></li>
|
182
|
+
<li><a href="values.html">Values</a></li>
|
183
|
+
<li><a href="valueSource.html">ValueSource</a></li>
|
184
|
+
</ul>
|
185
|
+
<li><a href="nunit-console.html">Console Runner</a></li>
|
186
|
+
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
187
|
+
<li><a href="configFiles.html">Configuration Files</a></li>
|
188
|
+
<li><a href="pnunit.html">PNUnit</a></li>
|
189
|
+
<li><a href="multiAssembly.html">Multiple Assemblies</a></li>
|
190
|
+
<li><a href="vsSupport.html">Visual Studio Support</a></li>
|
191
|
+
<li><a href="extensibility.html">Extensibility</a></li>
|
192
|
+
<li><a href="releaseNotes.html">Release Notes</a></li>
|
193
|
+
<li><a href="samples.html">Samples</a></li>
|
194
|
+
<li><a href="license.html">License</a></li>
|
195
|
+
</ul>
|
196
|
+
</ul>
|
197
|
+
</div>
|
198
|
+
<!-- End of Submenu -->
|
199
|
+
|
200
|
+
|
201
|
+
<!-- Standard Footer for NUnit.org -->
|
202
|
+
<div id="footer">
|
203
|
+
Copyright © 2009 Charlie Poole. All Rights Reserved.
|
204
|
+
</div>
|
205
|
+
<!-- End of Footer -->
|
206
|
+
|
207
|
+
</body>
|
208
|
+
</html>
|
@@ -0,0 +1,112 @@
|
|
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 - ThrowsConstraint</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>Throws Constraint (NUnit 2.5)</h2>
|
28
|
+
|
29
|
+
<p>ThrowsConstraint is used to test that some code, represented as a delegate,
|
30
|
+
throws a particular exception. It may be used alone, to merely test the type
|
31
|
+
of constraint, or with an additional constraint to be applied to the exception
|
32
|
+
specified as an argument.
|
33
|
+
|
34
|
+
<table class="constraints">
|
35
|
+
<tr><th>Syntax Helper</th><th>Constructor</th><th>Operation</th></tr>
|
36
|
+
<tr><td>Throws.Exception(Type)</td><td>ThrowsConstraint(Type)</td></td><td>tests that an exception of the specified type is thrown</td></tr>
|
37
|
+
<tr><td>Throws.Exception(Type,Constraint)</td><td>ThrowsConstraint(Type,Constraint)</td></td><td>tests that an exception of the specified type is thrown and that it satisifies the constrant provided as the second argument</td></tr>
|
38
|
+
<tr><td>Throws.Exception<T>()</td><td>ThrowsConstraint<T>()</td></td><td>tests that an exception of the specified type is thrown</td></tr>
|
39
|
+
<tr><td>Throws.Exception<T>(Constraint)</td><td>ThrowsConstraint<T>(Constraint)</td></td><td>tests that an exception of the specified type is thrown and that it satisifies the constrant provided as an argument</td></tr>
|
40
|
+
</table>
|
41
|
+
|
42
|
+
<h4>Examples</h4>
|
43
|
+
|
44
|
+
<div class="code"><pre>
|
45
|
+
|
46
|
+
// .NET 1.1
|
47
|
+
Assert.That( new TestDelegate(SomeMethod),
|
48
|
+
Throws.Exception(typeof(ArgumentException)));
|
49
|
+
Assert.That( new TestDelegate(SomeMethod),
|
50
|
+
Throws.Exception(typeof(ArgumentException),
|
51
|
+
Has.Property("Parameter", "myParam")));
|
52
|
+
|
53
|
+
// .NET 2.0
|
54
|
+
Assert.That( SomeMethod,
|
55
|
+
Throws.Exception<ArgumentException>());
|
56
|
+
Assert.That( SomeMethod,
|
57
|
+
Throws.Exception<ArgumentException>(
|
58
|
+
Has.Property("Parameter", "myParam")));
|
59
|
+
|
60
|
+
</pre></div>
|
61
|
+
|
62
|
+
|
63
|
+
</div>
|
64
|
+
|
65
|
+
<!-- Submenu -->
|
66
|
+
<div id="subnav">
|
67
|
+
<ul>
|
68
|
+
<li><a href="index.html">NUnit 2.5</a></li>
|
69
|
+
<ul>
|
70
|
+
<li><a href="getStarted.html">Getting Started</a></li>
|
71
|
+
<li><a href="assertions.html">Assertions</a></li>
|
72
|
+
<li><a href="constraintModel.html">Constraints</a></li>
|
73
|
+
<ul>
|
74
|
+
<li><a href="equalConstraint.html">Equal Constraint</a></li>
|
75
|
+
<li><a href="sameasConstraint.html">SameAs Constraint</a></li>
|
76
|
+
<li><a href="conditionConstraints.html">Condition Constraints</a></li>
|
77
|
+
<li><a href="comparisonConstraints.html">Comparison Constrants</a></li>
|
78
|
+
<li><a href="pathConstraints.html">Path Constraints</a></li>
|
79
|
+
<li><a href="typeConstraints.html">Type Constraints</a></li>
|
80
|
+
<li><a href="stringConstraints.html">String Constraints</a></li>
|
81
|
+
<li><a href="collectionConstraints.html">Collection Constraints</a></li>
|
82
|
+
<li><a href="propertyConstraint.html">Property Constraint</a></li>
|
83
|
+
<li id="current"><a href="throwsConstraint.html">Throws Constraint</a></li>
|
84
|
+
<li><a href="compoundConstraints.html">Compound Constraints</a></li>
|
85
|
+
<li><a href="delayedConstraint.html">Delayed Constraint</a></li>
|
86
|
+
<li><a href="listMapper.html">List Mapper</a></li>
|
87
|
+
</ul>
|
88
|
+
<li><a href="attributes.html">Attributes</a></li>
|
89
|
+
<li><a href="nunit-console.html">Console Runner</a></li>
|
90
|
+
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
91
|
+
<li><a href="configFiles.html">Configuration Files</a></li>
|
92
|
+
<li><a href="pnunit.html">PNUnit</a></li>
|
93
|
+
<li><a href="multiAssembly.html">Multiple Assemblies</a></li>
|
94
|
+
<li><a href="vsSupport.html">Visual Studio Support</a></li>
|
95
|
+
<li><a href="extensibility.html">Extensibility</a></li>
|
96
|
+
<li><a href="releaseNotes.html">Release Notes</a></li>
|
97
|
+
<li><a href="samples.html">Samples</a></li>
|
98
|
+
<li><a href="license.html">License</a></li>
|
99
|
+
</ul>
|
100
|
+
</ul>
|
101
|
+
</div>
|
102
|
+
<!-- End of Submenu -->
|
103
|
+
|
104
|
+
|
105
|
+
<!-- Standard Footer for NUnit.org -->
|
106
|
+
<div id="footer">
|
107
|
+
Copyright © 2009 Charlie Poole. All Rights Reserved.
|
108
|
+
</div>
|
109
|
+
<!-- End of Footer -->
|
110
|
+
|
111
|
+
</body>
|
112
|
+
</html>
|