nunit 2.4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/docs/addinsDialog.html +74 -0
- data/docs/assertions.html +91 -0
- data/docs/attributes.html +89 -0
- data/docs/category.html +265 -0
- data/docs/classicModel.html +92 -0
- data/docs/codeFuncs.js +77 -0
- data/docs/collectionAssert.html +162 -0
- data/docs/collectionConstraints.html +130 -0
- data/docs/comparisonAsserts.html +271 -0
- data/docs/comparisonConstraints.html +109 -0
- data/docs/compoundConstraints.html +97 -0
- data/docs/conditionAsserts.html +123 -0
- data/docs/conditionConstraints.html +106 -0
- data/docs/configEditor.html +93 -0
- data/docs/configFiles.html +155 -0
- data/docs/consoleCommandLine.html +271 -0
- data/docs/constraintModel.html +134 -0
- data/docs/contextMenu.html +106 -0
- data/docs/culture.html +255 -0
- data/docs/customAsserts.html +115 -0
- data/docs/customConstraints.html +101 -0
- data/docs/description.html +178 -0
- data/docs/equalConstraint.html +139 -0
- data/docs/equalityAsserts.html +187 -0
- data/docs/exception.html +296 -0
- data/docs/explicit.html +256 -0
- data/docs/extensibility.html +83 -0
- data/docs/favicon.ico +0 -0
- data/docs/features.html +75 -0
- data/docs/fileAssert.html +114 -0
- data/docs/files/QuickStart.Spanish.doc +0 -0
- data/docs/files/QuickStart.doc +0 -0
- data/docs/files/Results.xsd +70 -0
- data/docs/files/Summary.xslt +47 -0
- data/docs/files/TestResult.xml +103 -0
- data/docs/files/Thumbs.db +0 -0
- data/docs/fixtureSetup.html +201 -0
- data/docs/fixtureTeardown.html +204 -0
- data/docs/getStarted.html +80 -0
- data/docs/guiCommandLine.html +183 -0
- data/docs/identityAsserts.html +99 -0
- data/docs/ignore.html +249 -0
- data/docs/img/addinsDialog.JPG +0 -0
- data/docs/img/assembliesTab.jpg +0 -0
- data/docs/img/assemblyReloadOptions.JPG +0 -0
- data/docs/img/bulletOff.gif +0 -0
- data/docs/img/bulletOn.gif +0 -0
- data/docs/img/configEditor.jpg +0 -0
- data/docs/img/console-mock.jpg +0 -0
- data/docs/img/displayTab.jpg +0 -0
- data/docs/img/generalOptions.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/langFilter.gif +0 -0
- data/docs/img/logo.gif +0 -0
- data/docs/img/miniGui.jpg +0 -0
- data/docs/img/optionsDialog.jpg +0 -0
- data/docs/img/resultTab.jpg +0 -0
- data/docs/img/testLoadOptions.jpg +0 -0
- data/docs/img/testOutputOptions.jpg +0 -0
- data/docs/img/testProperties.jpg +0 -0
- data/docs/img/testResultOptions.JPG +0 -0
- data/docs/img/testTab.jpg +0 -0
- data/docs/img/testsTab.JPG +0 -0
- data/docs/img/textOutputOptions.jpg +0 -0
- data/docs/img/treeDisplayOptions.JPG +0 -0
- data/docs/img/visualStudioOptions.JPG +0 -0
- data/docs/index.html +75 -0
- data/docs/installation.html +172 -0
- data/docs/license.html +88 -0
- data/docs/listMapper.html +100 -0
- data/docs/mainMenu.html +260 -0
- data/docs/multiAssembly.html +130 -0
- data/docs/nunit-console.html +84 -0
- data/docs/nunit-gui.html +115 -0
- data/docs/nunit.css +118 -0
- data/docs/nunitAddins.html +331 -0
- data/docs/optionsDialog.html +262 -0
- data/docs/platform.html +285 -0
- data/docs/platformSupport.html +99 -0
- data/docs/projectEditor.html +127 -0
- data/docs/property.html +219 -0
- data/docs/propertyConstraint.html +89 -0
- data/docs/quickStart.html +314 -0
- data/docs/releaseNotes.html +1235 -0
- data/docs/sameasConstraint.html +98 -0
- data/docs/samples.html +126 -0
- data/docs/setCulture.html +173 -0
- data/docs/setup.html +199 -0
- data/docs/setupFixture.html +198 -0
- data/docs/stringAssert.html +107 -0
- data/docs/stringConstraints.html +111 -0
- data/docs/suite.html +222 -0
- data/docs/teardown.html +204 -0
- data/docs/test.html +171 -0
- data/docs/testFixture.html +168 -0
- data/docs/testProperties.html +76 -0
- data/docs/typeAsserts.html +101 -0
- data/docs/typeConstraints.html +103 -0
- data/docs/upgrade.html +97 -0
- data/docs/utilityAsserts.html +108 -0
- data/docs/vsSupport.html +140 -0
- data/lib/net-1.1/Failure.jpg +0 -0
- data/lib/net-1.1/Ignored.jpg +0 -0
- data/lib/net-1.1/NUnitFitTests.html +277 -0
- data/lib/net-1.1/NUnitTests.config +84 -0
- data/lib/net-1.1/NUnitTests.nunit +14 -0
- data/lib/net-1.1/Success.jpg +0 -0
- data/lib/net-1.1/clr.bat +96 -0
- data/lib/net-1.1/fit.dll +0 -0
- data/lib/net-1.1/loadtest-assembly.dll +0 -0
- 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.exe +0 -0
- data/lib/net-1.1/nunit-console.exe.config +117 -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.exe.config +121 -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.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 +5622 -0
- 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/nunit.util.tests.dll +0 -0
- data/lib/net-1.1/runFile.exe +0 -0
- data/lib/net-1.1/runFile.exe.config +43 -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/NUnitFitTests.html +277 -0
- data/lib/net-2.0/NUnitTests.config +84 -0
- data/lib/net-2.0/NUnitTests.nunit +14 -0
- data/lib/net-2.0/Success.jpg +0 -0
- data/lib/net-2.0/clr.bat +96 -0
- data/lib/net-2.0/fit.dll +0 -0
- data/lib/net-2.0/loadtest-assembly.dll +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-x86.exe +0 -0
- data/lib/net-2.0/nunit-console-x86.exe.config +117 -0
- data/lib/net-2.0/nunit-console.exe +0 -0
- data/lib/net-2.0/nunit-console.exe.config +117 -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-x86.exe +0 -0
- data/lib/net-2.0/nunit-x86.exe.config +121 -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.exe +0 -0
- data/lib/net-2.0/nunit.exe.config +121 -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.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 +5622 -0
- 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/nunit.util.tests.dll +0 -0
- data/lib/net-2.0/runFile.exe +0 -0
- data/lib/net-2.0/runFile.exe.config +43 -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
- metadata +262 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
|
2
|
+
<html>
|
|
3
|
+
<!-- Standard Head Part -->
|
|
4
|
+
<head>
|
|
5
|
+
<title>NUnit - SetupFixture</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
|
+
<script language="JavaScript" src="codeFuncs.js" ></script> <!-- Do it this way for IE -->
|
|
28
|
+
|
|
29
|
+
<h3>SetUpFixtureAttribute (NUnit 2.4)</h3>
|
|
30
|
+
|
|
31
|
+
<p>This is the attribute that marks a class that contains the one-time
|
|
32
|
+
setup or teardown methods for all the test fixtures under a given
|
|
33
|
+
namespace. The class may contain at most one method marked with the
|
|
34
|
+
SetUpAttribute and one method marked with the TearDownAttribute.</p>
|
|
35
|
+
|
|
36
|
+
<p>There are a few restrictions on a class that is used as a setup fixture.
|
|
37
|
+
<ul>
|
|
38
|
+
<li>
|
|
39
|
+
It must be a publicly exported type or NUnit will not see it.</li>
|
|
40
|
+
<li>
|
|
41
|
+
It must have a default constructor or NUnit will not be able to construct it.</li>
|
|
42
|
+
</ul>
|
|
43
|
+
</p>
|
|
44
|
+
|
|
45
|
+
<p>The SetUp method in a SetUpFixture is executed once before any of the fixtures
|
|
46
|
+
contained in its namespace. The TearDown method is executed once after all the
|
|
47
|
+
fixtures have completed execution. In the examples below, the method RunBeforeAnyTests()
|
|
48
|
+
is called before any tests or setup methods in the NUnit.Tests namespace. The method
|
|
49
|
+
RunAfterAnyTests() is called after all the tests in the namespace as well as their
|
|
50
|
+
individual or fixture teardowns have completed exection.</p>
|
|
51
|
+
|
|
52
|
+
<p>Only one SetUpFixture should be created in a given namespace. A SetUpFixture
|
|
53
|
+
outside of any namespace provides SetUp and TearDown for the entire assembly.
|
|
54
|
+
|
|
55
|
+
<h4>Example:</h4>
|
|
56
|
+
|
|
57
|
+
<div class="code">
|
|
58
|
+
|
|
59
|
+
<div class="langFilter">
|
|
60
|
+
<a href="javascript:Show('DD1')" onmouseover="Show('DD1')"><img src="img/langFilter.gif" width="14" height="14" alt="Language Filter"></a>
|
|
61
|
+
<div id="DD1" class="dropdown" style="display: none;" onclick="Hide('DD1')">
|
|
62
|
+
<a href="javascript:ShowCS()">C#</a><br>
|
|
63
|
+
<a href="javascript:ShowVB()">VB</a><br>
|
|
64
|
+
<a href="javascript:ShowMC()">C++</a><br>
|
|
65
|
+
<a href="javascript:ShowJS()">J#</a><br>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<pre class="cs">namespace NUnit.Tests
|
|
70
|
+
{
|
|
71
|
+
using System;
|
|
72
|
+
using NUnit.Framework;
|
|
73
|
+
|
|
74
|
+
[SetUpFixture]
|
|
75
|
+
public class MySetUpClass
|
|
76
|
+
{
|
|
77
|
+
[SetUp]
|
|
78
|
+
RunBeforeAnyTests()
|
|
79
|
+
{
|
|
80
|
+
// ...
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
[TearDown]
|
|
84
|
+
RunAfterAnyTests()
|
|
85
|
+
{
|
|
86
|
+
// ...
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
</pre>
|
|
91
|
+
|
|
92
|
+
<pre class="vb">Imports System
|
|
93
|
+
Imports Nunit.Framework
|
|
94
|
+
|
|
95
|
+
Namespace Nunit.Tests
|
|
96
|
+
|
|
97
|
+
<TestFixture()> Public Class MySetUpClass
|
|
98
|
+
<SetUp()> Public Sub RunBeforeAnyTests()
|
|
99
|
+
' ...
|
|
100
|
+
End Sub
|
|
101
|
+
|
|
102
|
+
<TearDown()> Public Sub RunAfterAnyTests()
|
|
103
|
+
' ...
|
|
104
|
+
End Sub
|
|
105
|
+
End Class
|
|
106
|
+
End Namespace
|
|
107
|
+
</pre>
|
|
108
|
+
|
|
109
|
+
<pre class="mc">#using <Nunit.Framework.dll>
|
|
110
|
+
using namespace System;
|
|
111
|
+
using namespace NUnit::Framework;
|
|
112
|
+
|
|
113
|
+
namespace NUnitTests
|
|
114
|
+
{
|
|
115
|
+
[TestFixture]
|
|
116
|
+
public __gc class MySetUpClass
|
|
117
|
+
{
|
|
118
|
+
[SetUp] public void RunBeforeAnyTests();
|
|
119
|
+
[TearDown] public void RunAfterAnyTests();
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
#include "cppsample.h"
|
|
124
|
+
|
|
125
|
+
namespace NUnitTests {
|
|
126
|
+
// ...
|
|
127
|
+
}
|
|
128
|
+
</pre>
|
|
129
|
+
|
|
130
|
+
<pre class="js">package NUnit.Tests;
|
|
131
|
+
|
|
132
|
+
import System.*;
|
|
133
|
+
import NUnit.Framework.TestFixture;
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
/** @attribute NUnit.Framework.TestFixture() */
|
|
137
|
+
public class MySetUpClass
|
|
138
|
+
{
|
|
139
|
+
/** @attribute NUnit.Framework.SetUp() */
|
|
140
|
+
public void RunBeforeAnyTests()
|
|
141
|
+
{ /* ... */ }
|
|
142
|
+
|
|
143
|
+
/** @attribute NUnit.Framework.TearDown() */
|
|
144
|
+
public void RunAfterAnyTests()
|
|
145
|
+
{ /* ... */ }
|
|
146
|
+
}
|
|
147
|
+
</pre>
|
|
148
|
+
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
<!-- Submenu -->
|
|
153
|
+
<div id="subnav">
|
|
154
|
+
<ul>
|
|
155
|
+
<li><a href="index.html">NUnit 2.4.8</a></li>
|
|
156
|
+
<ul>
|
|
157
|
+
<li><a href="getStarted.html">Getting Started</a></li>
|
|
158
|
+
<li><a href="assertions.html">Assertions</a></li>
|
|
159
|
+
<li><a href="attributes.html">Attributes</a></li>
|
|
160
|
+
<ul>
|
|
161
|
+
<li><a href="category.html">Category</a></li>
|
|
162
|
+
<li><a href="culture.html">Culture</a></li>
|
|
163
|
+
<li><a href="description.html">Description</a></li>
|
|
164
|
+
<li><a href="exception.html">Expected Exception</a></li>
|
|
165
|
+
<li><a href="explicit.html">Explicit</a></li>
|
|
166
|
+
<li><a href="ignore.html">Ignore</a></li>
|
|
167
|
+
<li><a href="platform.html">Platform</a></li>
|
|
168
|
+
<li><a href="property.html">Property</a></li>
|
|
169
|
+
<li><a href="setCulture.html">SetCulture</a></li>
|
|
170
|
+
<li><a href="setup.html">Setup</a></li>
|
|
171
|
+
<li id="current"><a href="setupFixture.html">SetUp Fixture</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="testFixture.html">Test Fixture</a></li>
|
|
176
|
+
<li><a href="fixtureSetup.html">Test Fixture SetUp</a></li>
|
|
177
|
+
<li><a href="fixtureTeardown.html">Test Fixture TearDown</a></li>
|
|
178
|
+
</ul>
|
|
179
|
+
<li><a href="nunit-console.html">Console Runner</a></li>
|
|
180
|
+
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
|
181
|
+
<li><a href="features.html">Other Features</a></li>
|
|
182
|
+
<li><a href="releaseNotes.html">Release Notes</a></li>
|
|
183
|
+
<li><a href="samples.html">Samples</a></li>
|
|
184
|
+
<li><a href="license.html">License</a></li>
|
|
185
|
+
</ul>
|
|
186
|
+
</ul>
|
|
187
|
+
</div>
|
|
188
|
+
<!-- End of Submenu -->
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
<!-- Standard Footer for NUnit.org -->
|
|
192
|
+
<div id="footer">
|
|
193
|
+
Copyright © 2008 Charlie Poole. All Rights Reserved.
|
|
194
|
+
</div>
|
|
195
|
+
<!-- End of Footer -->
|
|
196
|
+
|
|
197
|
+
</body>
|
|
198
|
+
</html>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
|
2
|
+
<html>
|
|
3
|
+
<!-- Standard Head Part -->
|
|
4
|
+
<head>
|
|
5
|
+
<title>NUnit - StringAssert</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>StringAssert (NUnit 2.2.3)</h2>
|
|
28
|
+
<p>The StringAssert class provides a number of methods that are useful
|
|
29
|
+
when examining string values.</p>
|
|
30
|
+
|
|
31
|
+
<div class="code" style="width: 36em">
|
|
32
|
+
<pre>StringAssert.Contains( string expected, string actual );
|
|
33
|
+
StringAssert.Contains( string expected, string actual,
|
|
34
|
+
string message );
|
|
35
|
+
StringAssert.Contains( string expected, string actual,
|
|
36
|
+
string message, params object[] args );
|
|
37
|
+
|
|
38
|
+
StringAssert.StartsWith( string expected, string actual );
|
|
39
|
+
StringAssert.StartsWith( string expected, string actual,
|
|
40
|
+
string message );
|
|
41
|
+
StringAssert.StartsWith( string expected, string actual,
|
|
42
|
+
string message, params object[] args );
|
|
43
|
+
|
|
44
|
+
StringAssert.EndsWith( string expected, string actual );
|
|
45
|
+
StringAssert.EndsWith( string expected, string actual,
|
|
46
|
+
string message );
|
|
47
|
+
StringAssert.EndsWith( string expected, string actual,
|
|
48
|
+
string message, params object[] args );
|
|
49
|
+
|
|
50
|
+
StringAssert.AreEqualIgnoringCase( string expected, string actual );
|
|
51
|
+
StringAssert.AreEqualIgnoringCase( string expected, string actual,
|
|
52
|
+
string message );
|
|
53
|
+
StringAssert.AreEqualIgnoringCase( string expected, string actual,
|
|
54
|
+
string message params object[] args );
|
|
55
|
+
|
|
56
|
+
StringAssert.IsMatch( string expected, string actual );
|
|
57
|
+
StringAssert.IsMatch( string expected, string actual,
|
|
58
|
+
string message );
|
|
59
|
+
StringAssert.IsMatch( string expected, string actual,
|
|
60
|
+
string message, params object[] args );</pre>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<!-- Submenu -->
|
|
66
|
+
<div id="subnav">
|
|
67
|
+
<ul>
|
|
68
|
+
<li><a href="index.html">NUnit 2.4.8</a></li>
|
|
69
|
+
<ul>
|
|
70
|
+
<li><a href="getStarted.html">Getting Started</a></li>
|
|
71
|
+
<li><a href="assertions.html">Assertions</a></li>
|
|
72
|
+
<ul>
|
|
73
|
+
<li><a href="classicModel.html">Classic Model</a></li>
|
|
74
|
+
<ul>
|
|
75
|
+
<li><a href="equalityAsserts.html">Equality Asserts</a></li>
|
|
76
|
+
<li><a href="identityAsserts.html">Identity Asserts</a></li>
|
|
77
|
+
<li><a href="conditionAsserts.html">Condition Tests</a></li>
|
|
78
|
+
<li><a href="comparisonAsserts.html">Comparison Asserts</a></li>
|
|
79
|
+
<li><a href="typeAsserts.html">Type Asserts</a></li>
|
|
80
|
+
<li><a href="utilityAsserts.html">Utility Methods</a></li>
|
|
81
|
+
<li id="current"><a href="stringAssert.html">String Assert</a></li>
|
|
82
|
+
<li><a href="collectionAssert.html">Collection Assert</a></li>
|
|
83
|
+
<li><a href="fileAssert.html">File Assert</a></li>
|
|
84
|
+
</ul>
|
|
85
|
+
<li><a href="constraintModel.html">Constraint Model</a></li>
|
|
86
|
+
</ul>
|
|
87
|
+
<li><a href="attributes.html">Attributes</a></li>
|
|
88
|
+
<li><a href="nunit-console.html">Console Runner</a></li>
|
|
89
|
+
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
|
90
|
+
<li><a href="features.html">Other Features</a></li>
|
|
91
|
+
<li><a href="releaseNotes.html">Release Notes</a></li>
|
|
92
|
+
<li><a href="samples.html">Samples</a></li>
|
|
93
|
+
<li><a href="license.html">License</a></li>
|
|
94
|
+
</ul>
|
|
95
|
+
</ul>
|
|
96
|
+
</div>
|
|
97
|
+
<!-- End of Submenu -->
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
<!-- Standard Footer for NUnit.org -->
|
|
101
|
+
<div id="footer">
|
|
102
|
+
Copyright © 2008 Charlie Poole. All Rights Reserved.
|
|
103
|
+
</div>
|
|
104
|
+
<!-- End of Footer -->
|
|
105
|
+
|
|
106
|
+
</body>
|
|
107
|
+
</html>
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
|
2
|
+
<html>
|
|
3
|
+
<!-- Standard Head Part -->
|
|
4
|
+
<head>
|
|
5
|
+
<title>NUnit - StringConstraints</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>String Constraints (NUnit 2.4)</h2>
|
|
28
|
+
|
|
29
|
+
<p>String constraints perform tests that are specific to strings.
|
|
30
|
+
The following string constraints are provided.
|
|
31
|
+
|
|
32
|
+
<table class="constraints">
|
|
33
|
+
<tr><th>Syntax Helpers</th><th>Constructor</th><th>Operation</th></tr>
|
|
34
|
+
<tr><td>Text.Contains( string )<br>Text.DoesNotContain( string )</td><td>SubstringConstraint( string )</td></td><td>tests for a substring</td></tr>
|
|
35
|
+
<tr><td>Text.StartsWith( string )<br>Text.DoesNotStartWith( string )</td><td>StartsWithConstraint( string )</td></td><td>tests for an initial string</td></tr>
|
|
36
|
+
<tr><td>Text.EndsWith( string )<br>Text.DoesNotEndWith( string )</td><td>EndsWithConstraint( string )</td></td><td>tests for an ending string</td></tr>
|
|
37
|
+
<tr><td>Text.Matches( string )<br>Text.DoesNotMatch( string )</td><td>RegexConstraint( string )</td></td><td>tests that a pattern is matched</td></tr>
|
|
38
|
+
</table>
|
|
39
|
+
|
|
40
|
+
<h4>Examples</h4>
|
|
41
|
+
|
|
42
|
+
<div class="code" style="width: 36em"><pre>
|
|
43
|
+
string phrase = "Make your tests fail before passing!"
|
|
44
|
+
|
|
45
|
+
Assert.That( phrase, Text.Contains( "tests fail" ) );
|
|
46
|
+
Assert.That( phrase, Text.Contains( "make" ).IgnoreCase );
|
|
47
|
+
|
|
48
|
+
Assert.That( phrase, Text.StartsWith( "Make" ) );
|
|
49
|
+
Assert.That( phrase, Text.Not.StartsWith( "Break" ) );
|
|
50
|
+
Assert.That( phrase, Text.DoesNotStartWith( "Break" ) );
|
|
51
|
+
|
|
52
|
+
Assert.That( phrase, Text.EndsWith( "!" ) );
|
|
53
|
+
Assert.That( phrase, Text.EndsWith( "PASSING!" ).IgnoreCase );
|
|
54
|
+
|
|
55
|
+
Assert.That( phrase, Text.Matches( "Make.*tests.*pass" ) );
|
|
56
|
+
Assert.That( phrase, Text.Not.Matches( "your.*passing.*tests" ) );
|
|
57
|
+
Assert.That( phrase, Text.DoesNotMatch( "your.*passing.*tests" ) );
|
|
58
|
+
|
|
59
|
+
// Using Inheritance
|
|
60
|
+
Expect( phrase, Contains( "make" ).IgnoreCase );
|
|
61
|
+
Expect( phrase, EndsWith( "!" ) );
|
|
62
|
+
Expect( phrase, Matches( "Make.*pass" ) );
|
|
63
|
+
</pre></div>
|
|
64
|
+
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<!-- Submenu -->
|
|
68
|
+
<div id="subnav">
|
|
69
|
+
<ul>
|
|
70
|
+
<li><a href="index.html">NUnit 2.4.8</a></li>
|
|
71
|
+
<ul>
|
|
72
|
+
<li><a href="getStarted.html">Getting Started</a></li>
|
|
73
|
+
<li><a href="assertions.html">Assertions</a></li>
|
|
74
|
+
<ul>
|
|
75
|
+
<li><a href="classicModel.html">Classic Model</a></li>
|
|
76
|
+
<li><a href="constraintModel.html">Constraint Model</a></li>
|
|
77
|
+
<ul>
|
|
78
|
+
<li><a href="equalConstraint.html">Equal Constraint</a></li>
|
|
79
|
+
<li><a href="sameasConstraint.html">SameAs Constraint</a></li>
|
|
80
|
+
<li><a href="conditionConstraints.html">Condition Constraints</a></li>
|
|
81
|
+
<li><a href="comparisonConstraints.html">Comparison Constrants</a></li>
|
|
82
|
+
<li><a href="typeConstraints.html">Type Constraints</a></li>
|
|
83
|
+
<li id="current"><a href="stringConstraints.html">String Constraints</a></li>
|
|
84
|
+
<li><a href="collectionConstraints.html">Collection Constraints</a></li>
|
|
85
|
+
<li><a href="propertyConstraint.html">Property Constraint</a></li>
|
|
86
|
+
<li><a href="compoundConstraints.html">Compound Constraints</a></li>
|
|
87
|
+
<li><a href="customConstraints.html">Custom Constraints</a></li>
|
|
88
|
+
<li><a href="listMapper.html">List Mapper</a></li>
|
|
89
|
+
</ul>
|
|
90
|
+
</ul>
|
|
91
|
+
<li><a href="attributes.html">Attributes</a></li>
|
|
92
|
+
<li><a href="nunit-console.html">Console Runner</a></li>
|
|
93
|
+
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
|
94
|
+
<li><a href="features.html">Other Features</a></li>
|
|
95
|
+
<li><a href="releaseNotes.html">Release Notes</a></li>
|
|
96
|
+
<li><a href="samples.html">Samples</a></li>
|
|
97
|
+
<li><a href="license.html">License</a></li>
|
|
98
|
+
</ul>
|
|
99
|
+
</ul>
|
|
100
|
+
</div>
|
|
101
|
+
<!-- End of Submenu -->
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
<!-- Standard Footer for NUnit.org -->
|
|
105
|
+
<div id="footer">
|
|
106
|
+
Copyright © 2008 Charlie Poole. All Rights Reserved.
|
|
107
|
+
</div>
|
|
108
|
+
<!-- End of Footer -->
|
|
109
|
+
|
|
110
|
+
</body>
|
|
111
|
+
</html>
|
data/docs/suite.html
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
|
2
|
+
<html>
|
|
3
|
+
<!-- Standard Head Part -->
|
|
4
|
+
<head>
|
|
5
|
+
<title>NUnit - Suite</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
|
+
<div style="float:right"><b>Update: August 22, 2007</b></div>
|
|
28
|
+
<h3>SuiteAttribute (NUnit 2.0/2.4.4)</h3>
|
|
29
|
+
|
|
30
|
+
<p>The Suite Attribute is used to define subsets of test to be run from the
|
|
31
|
+
command-line, using the <b>/fixture</b> option. It was introduced in NUnit
|
|
32
|
+
2.0 to replace the older approach of inheriting from the TestSuite class.</p>
|
|
33
|
+
|
|
34
|
+
<p>Originally, the NUnit developers believed that the need for the Suite
|
|
35
|
+
mechanism would diminish because of the dynamic creation of suites based
|
|
36
|
+
on namespaces. It was provided for backwards compatibility.</p>
|
|
37
|
+
|
|
38
|
+
<p>That has not proven to be true. Suites are still used today by many people,
|
|
39
|
+
so we are making an effort to revive them in terms of usability.
|
|
40
|
+
|
|
41
|
+
<p>The Suite mechanism depends on a static property marked with the </b>SuiteAttribute</b>.
|
|
42
|
+
In the clasic implementation, supported by all releases since 2.0, that property
|
|
43
|
+
returns a TestSuite, populated with the tests that are to be executed.
|
|
44
|
+
|
|
45
|
+
<h4>Old Approach</h4>
|
|
46
|
+
|
|
47
|
+
<div class="code">
|
|
48
|
+
|
|
49
|
+
<pre>namespace NUnit.Tests
|
|
50
|
+
{
|
|
51
|
+
using System;
|
|
52
|
+
using NUnit.Framework;
|
|
53
|
+
using NUnit.Core;
|
|
54
|
+
|
|
55
|
+
public class AllTests
|
|
56
|
+
{
|
|
57
|
+
[Suite]
|
|
58
|
+
public static TestSuite Suite
|
|
59
|
+
{
|
|
60
|
+
get
|
|
61
|
+
{
|
|
62
|
+
TestSuite suite = new TestSuite("All Tests");
|
|
63
|
+
suite.Add(new OneTestCase());
|
|
64
|
+
suite.Add(new Assemblies.AssemblyTests());
|
|
65
|
+
suite.Add(new AssertionTest());
|
|
66
|
+
return suite;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</pre>
|
|
72
|
+
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<p>This approach has a serious problem: it requires a reference to the nunit.core assembly,
|
|
76
|
+
which is not normally referenced by user tests. This means that the tests
|
|
77
|
+
cannot be ported across versions of NUnit without recompilation. In some cases,
|
|
78
|
+
introducing more than one version of the core assembly can prevent NUnit
|
|
79
|
+
from running correctly.
|
|
80
|
+
|
|
81
|
+
<p>Beginning with NUnit 2.4.4, a new approach is available. The property marked
|
|
82
|
+
with the <b>SuiteAttribute</b> may simply return a collection containing test
|
|
83
|
+
fixture objects or Types.
|
|
84
|
+
If a Type is provided, NUnit creates an object of that type for use
|
|
85
|
+
as a fixture. Any other object is assumed to be a pre-created fixture object.
|
|
86
|
+
This allows objects with parameterized constructors or settable
|
|
87
|
+
properties to be used as fixtures.
|
|
88
|
+
|
|
89
|
+
<p>Test suites created through use of the <b>SuiteAttribute</b> may contain <b>TestFixtureSetUp</b> and
|
|
90
|
+
<b>TestFixtureTearDown</b> methods, to perform one-time setup and teardown
|
|
91
|
+
for the tests included in the suite.
|
|
92
|
+
|
|
93
|
+
<h4>New Approach - Fixture Objects</h4>
|
|
94
|
+
|
|
95
|
+
<div class="code">
|
|
96
|
+
|
|
97
|
+
<pre>namespace NUnit.Tests
|
|
98
|
+
{
|
|
99
|
+
using System;
|
|
100
|
+
using NUnit.Framework;
|
|
101
|
+
|
|
102
|
+
private class AllTests
|
|
103
|
+
{
|
|
104
|
+
[Suite]
|
|
105
|
+
public static IEnumerable Suite
|
|
106
|
+
{
|
|
107
|
+
get
|
|
108
|
+
{
|
|
109
|
+
ArrayList suite = new ArrayList();
|
|
110
|
+
suite.Add(new OneTestCase());
|
|
111
|
+
suite.Add(new AssemblyTests());
|
|
112
|
+
suite.Add(new NoNamespaceTestFixture());
|
|
113
|
+
return suite;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
</pre>
|
|
119
|
+
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<h4>New Approach - Fixture Types</h4>
|
|
123
|
+
|
|
124
|
+
<div class="code">
|
|
125
|
+
|
|
126
|
+
<pre>namespace NUnit.Tests
|
|
127
|
+
{
|
|
128
|
+
using System;
|
|
129
|
+
using NUnit.Framework;
|
|
130
|
+
|
|
131
|
+
private class AllTests
|
|
132
|
+
{
|
|
133
|
+
[Suite]
|
|
134
|
+
public static IEnumerable Suite
|
|
135
|
+
{
|
|
136
|
+
get
|
|
137
|
+
{
|
|
138
|
+
ArrayList suite = new ArrayList();
|
|
139
|
+
suite.Add(typeof(OneTestCase));
|
|
140
|
+
suite.Add(typeof(AssemblyTests));
|
|
141
|
+
suite.Add(typeof(NoNamespaceTestFixture));
|
|
142
|
+
return suite;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
</pre>
|
|
148
|
+
|
|
149
|
+
</div>
|
|
150
|
+
|
|
151
|
+
<h4>Limitations</h4>
|
|
152
|
+
|
|
153
|
+
NUnit support for user-defined Suites currently has two limitations:
|
|
154
|
+
|
|
155
|
+
<ol>
|
|
156
|
+
<li>It is not possible to include individual test cases directly
|
|
157
|
+
in a Suite using the new approach. Anyone wanting to do so will
|
|
158
|
+
need to use the old approach and create an object derive from
|
|
159
|
+
NUnit.Core.TestCase. This is not recommended, since it requires
|
|
160
|
+
a reference to the core assembly.
|
|
161
|
+
|
|
162
|
+
<li>Suites are currently not displayed in the Gui or run automatically
|
|
163
|
+
by either runner when they are encountered. The historical purpose of
|
|
164
|
+
the Suite mechanism was to provide a way of aggregating tests at the
|
|
165
|
+
top level of each run. Hence, they are only supported when used with
|
|
166
|
+
the /fixture option on the console or gui command line.
|
|
167
|
+
top level of an application. Thus, they may only
|
|
168
|
+
outcome of the historical purpose of
|
|
169
|
+
</ol>
|
|
170
|
+
|
|
171
|
+
Approaches to removing these limitations are being investigated as part
|
|
172
|
+
of the planning for future NUnit releases.
|
|
173
|
+
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
<!-- Submenu -->
|
|
177
|
+
<div id="subnav">
|
|
178
|
+
<ul>
|
|
179
|
+
<li><a href="index.html">NUnit 2.4.8</a></li>
|
|
180
|
+
<ul>
|
|
181
|
+
<li><a href="getStarted.html">Getting Started</a></li>
|
|
182
|
+
<li><a href="assertions.html">Assertions</a></li>
|
|
183
|
+
<li><a href="attributes.html">Attributes</a></li>
|
|
184
|
+
<ul>
|
|
185
|
+
<li><a href="category.html">Category</a></li>
|
|
186
|
+
<li><a href="culture.html">Culture</a></li>
|
|
187
|
+
<li><a href="description.html">Description</a></li>
|
|
188
|
+
<li><a href="exception.html">Expected Exception</a></li>
|
|
189
|
+
<li><a href="explicit.html">Explicit</a></li>
|
|
190
|
+
<li><a href="ignore.html">Ignore</a></li>
|
|
191
|
+
<li><a href="platform.html">Platform</a></li>
|
|
192
|
+
<li><a href="property.html">Property</a></li>
|
|
193
|
+
<li><a href="setCulture.html">SetCulture</a></li>
|
|
194
|
+
<li><a href="setup.html">Setup</a></li>
|
|
195
|
+
<li><a href="setupFixture.html">SetUp Fixture</a></li>
|
|
196
|
+
<li id="current"><a href="suite.html">Suite</a></li>
|
|
197
|
+
<li><a href="teardown.html">Teardown</a></li>
|
|
198
|
+
<li><a href="test.html">Test</a></li>
|
|
199
|
+
<li><a href="testFixture.html">Test Fixture</a></li>
|
|
200
|
+
<li><a href="fixtureSetup.html">Test Fixture SetUp</a></li>
|
|
201
|
+
<li><a href="fixtureTeardown.html">Test Fixture TearDown</a></li>
|
|
202
|
+
</ul>
|
|
203
|
+
<li><a href="nunit-console.html">Console Runner</a></li>
|
|
204
|
+
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
|
205
|
+
<li><a href="features.html">Other Features</a></li>
|
|
206
|
+
<li><a href="releaseNotes.html">Release Notes</a></li>
|
|
207
|
+
<li><a href="samples.html">Samples</a></li>
|
|
208
|
+
<li><a href="license.html">License</a></li>
|
|
209
|
+
</ul>
|
|
210
|
+
</ul>
|
|
211
|
+
</div>
|
|
212
|
+
<!-- End of Submenu -->
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
<!-- Standard Footer for NUnit.org -->
|
|
216
|
+
<div id="footer">
|
|
217
|
+
Copyright © 2008 Charlie Poole. All Rights Reserved.
|
|
218
|
+
</div>
|
|
219
|
+
<!-- End of Footer -->
|
|
220
|
+
|
|
221
|
+
</body>
|
|
222
|
+
</html>
|