nunit 2.4.8.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,314 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
2
|
+
<html>
|
3
|
+
<!-- Standard Head Part -->
|
4
|
+
<head>
|
5
|
+
<title>NUnit - QuickStart</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
|
+
<style><!--
|
28
|
+
div.code { width: 34em }
|
29
|
+
--></style>
|
30
|
+
|
31
|
+
<h2>NUnit Quick Start</h2>
|
32
|
+
|
33
|
+
<p><b>Note:</b> This page is based on the original QuickStart.doc, found in
|
34
|
+
earlier releases of NUnit. It has been pointed out that it isn't a good
|
35
|
+
example of Test-Driven Development. However, we're keeping it in the docs
|
36
|
+
because it does illustrate the basics of using NUnit. We'll revise or replace
|
37
|
+
it in a future release.</p>
|
38
|
+
|
39
|
+
<p>Let�s start with a simple example. Suppose we are writing a bank application and we have a basic domain class � Account. Account supports operations to deposit, withdraw, and transfer funds. The Account class may look like this:</p>
|
40
|
+
|
41
|
+
<div class="code">
|
42
|
+
<pre>namespace bank
|
43
|
+
{
|
44
|
+
public class Account
|
45
|
+
{
|
46
|
+
private float balance;
|
47
|
+
public void Deposit(float amount)
|
48
|
+
{
|
49
|
+
balance+=amount;
|
50
|
+
}
|
51
|
+
|
52
|
+
public void Withdraw(float amount)
|
53
|
+
{
|
54
|
+
balance-=amount;
|
55
|
+
}
|
56
|
+
|
57
|
+
public void TransferFunds(Account destination, float amount)
|
58
|
+
{
|
59
|
+
}
|
60
|
+
|
61
|
+
public float Balance
|
62
|
+
{
|
63
|
+
get{ return balance;}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}</pre>
|
67
|
+
</div>
|
68
|
+
|
69
|
+
<p>Now let�s write a test for this class � AccountTest. The first method we will test is TransferFunds.</p>
|
70
|
+
|
71
|
+
<div class="code">
|
72
|
+
<pre>namespace bank
|
73
|
+
{
|
74
|
+
using NUnit.Framework;
|
75
|
+
|
76
|
+
[TestFixture]
|
77
|
+
public class AccountTest
|
78
|
+
{
|
79
|
+
[Test]
|
80
|
+
public void TransferFunds()
|
81
|
+
{
|
82
|
+
Account source = new Account();
|
83
|
+
source.Deposit(200.00F);
|
84
|
+
Account destination = new Account();
|
85
|
+
destination.Deposit(150.00F);
|
86
|
+
|
87
|
+
source.TransferFunds(destination, 100.00F);
|
88
|
+
Assert.AreEqual(250.00F, destination.Balance);
|
89
|
+
Assert.AreEqual(100.00F, source.Balance);
|
90
|
+
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}</pre>
|
94
|
+
</div>
|
95
|
+
|
96
|
+
<p>The first thing to notice about this class is that it has a [TestFixture] attribute associated with it � this is the way to indicate that the class contains test code (this attribute can be inherited). The class has to be public and there are no restrictions on its superclass. The class also has to have a default constructor.</p>
|
97
|
+
|
98
|
+
<p>The only method in the class � TransferFunds, has a [Test] attribute associated with it � this is an indication that it is a test method. Test methods have to return void and take no parameters. In our test method we do the usual initialization of the required test objects, execute the tested business method and check the state of the business objects. The Assert class defines a collection of methods used to check the post-conditions and in our example we use the AreEqual method to make sure that after the transfer both accounts have the correct balances (there are several overloadings of this method, the version that was used in this example has the following parameters : the first parameter is an expected value and the second parameter is the actual value).</p>
|
99
|
+
|
100
|
+
<p>Compile and run this example. Assume that you have compiled your test code into a bank.dll. Start the NUnit Gui (the installer will have created a shortcut on your desktop and in the �Program Files� folder), after the GUI starts, select the File->Open menu item, navigate to the location of your bank.dll and select it in the �Open� dialog box. When the bank.dll is loaded you will see a test tree structure in the left panel and a collection of status panels on the right. Click the Run button, the status bar and the TransferFunds node in the test tree turn red � our test has failed. The �Errors and Failures� panel displayed the following message:
|
101
|
+
|
102
|
+
<pre> TransferFunds : expected <250> but was <150></pre>
|
103
|
+
|
104
|
+
and the stack trace panel right below it reported where in the test code the failure has occurred �
|
105
|
+
|
106
|
+
<pre> at bank.AccountTest.TransferFunds() in C:\nunit\BankSampleTests\AccountTest.cs:line 17</pre></p>
|
107
|
+
|
108
|
+
<p>That is expected behavior; the test has failed because we have not implemented the TransferFunds method yet. Now let�s get it to work. Don�t close the GUI and go back to your IDE and fix the code, make your TransferFunds method look like this:</p>
|
109
|
+
|
110
|
+
<div class="code">
|
111
|
+
<pre>public void TransferFunds(Account destination, float amount)
|
112
|
+
{
|
113
|
+
destination.Deposit(amount);
|
114
|
+
Withdraw(amount);
|
115
|
+
}</pre>
|
116
|
+
</div>
|
117
|
+
|
118
|
+
|
119
|
+
<p>Now recompile your code and click the run button in GUI again � the status bar and the test tree turn green. (Note how the GUI has reloaded the assembly automatically for you; we will keep the GUI open all the time and continue working with our code in IDE and write more tests).</p>
|
120
|
+
|
121
|
+
<p>Let�s add some error checking to our Account code. We are adding the minimum balance requirement for the account to make sure that banks continue to make their money by charging your minimal overdraft protection fee. Let�s add the minimum balance property to our Account class:</p>
|
122
|
+
|
123
|
+
<div class="code">
|
124
|
+
<pre>private float minimumBalance = 10.00F;
|
125
|
+
public float MinimumBalance
|
126
|
+
{
|
127
|
+
get{ return minimumBalance;}
|
128
|
+
}</pre>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
<p>We will use an exception to indicate an overdraft:</p>
|
132
|
+
|
133
|
+
<div class="code">
|
134
|
+
<pre>namespace bank
|
135
|
+
{
|
136
|
+
using System;
|
137
|
+
public class InsufficientFundsException : ApplicationException
|
138
|
+
{
|
139
|
+
}
|
140
|
+
}</pre>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
<p>Add a new test method to our AccountTest class:</p>
|
144
|
+
|
145
|
+
<div class="code">
|
146
|
+
<pre>[Test]
|
147
|
+
[ExpectedException(typeof(InsufficientFundsException))]
|
148
|
+
public void TransferWithInsufficientFunds()
|
149
|
+
{
|
150
|
+
Account source = new Account();
|
151
|
+
source.Deposit(200.00F);
|
152
|
+
Account destination = new Account();
|
153
|
+
destination.Deposit(150.00F);
|
154
|
+
source.TransferFunds(destination, 300.00F);
|
155
|
+
}</pre>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
<p>This test method in addition to [Test] attribute has an [ExpectedException] attribute associated with it � this is the way to indicate that the test code is expecting an exception of a certain type; if such an exception is not thrown during the execution � the test will fail. Compile your code and go back to the GUI. As you compiled your test code, the GUI has grayed out and collapsed the test tree as if the tests were not run yet (GUI watches for the changes made to the test assemblies and updates itself when the structure of the test tree has changed � e.g. new test is added). Click the �Run� button � we have a red status bar again. We got the following Failure :
|
159
|
+
|
160
|
+
<pre> TransferWithInsufficentFunds : InsufficientFundsException was expected</pre>
|
161
|
+
|
162
|
+
Let�s fix our Account code again, modify the TransferFunds method this way:</p>
|
163
|
+
|
164
|
+
<div class="code">
|
165
|
+
<pre>public void TransferFunds(Account destination, float amount)
|
166
|
+
{
|
167
|
+
destination.Deposit(amount);
|
168
|
+
if(balance-amount<minimumBalance)
|
169
|
+
throw new InsufficientFundsException();
|
170
|
+
Withdraw(amount);
|
171
|
+
}</pre>
|
172
|
+
</div>
|
173
|
+
|
174
|
+
<p>Compile and run the tests � green bar. Success! But wait, looking at the code we�ve just written we can see that the bank may be loosing money on every unsuccessful funds Transfer operation. Let�s write a test to confirm our suspicions. Add this test method:</p>
|
175
|
+
|
176
|
+
<div class="code">
|
177
|
+
<pre>[Test]
|
178
|
+
public void TransferWithInsufficientFundsAtomicity()
|
179
|
+
{
|
180
|
+
Account source = new Account();
|
181
|
+
source.Deposit(200.00F);
|
182
|
+
Account destination = new Account();
|
183
|
+
destination.Deposit(150.00F);
|
184
|
+
try
|
185
|
+
{
|
186
|
+
source.TransferFunds(destination, 300.00F);
|
187
|
+
}
|
188
|
+
catch(InsufficientFundsException expected)
|
189
|
+
{
|
190
|
+
}
|
191
|
+
|
192
|
+
Assert.AreEqual(200.00F,source.Balance);
|
193
|
+
Assert.AreEqual(150.00F,destination.Balance);
|
194
|
+
}</pre>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
<p>We are testing the transactional property of our business method � all operations are successful or none. Compile and run � red bar. OK, we�ve made $300.00 out of a thin air (1999.com d�j� vu?) � the source account has the correct balance of 200.00 but the destination account shows : $450.00. How do we fix this? Can we just move the minimum balance check call in front of the updates:</p>
|
198
|
+
|
199
|
+
<div class="code">
|
200
|
+
<pre>public void TransferFunds(Account destination, float amount)
|
201
|
+
{
|
202
|
+
if(balance-amount<minimumBalance)
|
203
|
+
throw new InsufficientFundsException();
|
204
|
+
destination.Deposit(amount);
|
205
|
+
Withdraw(amount);
|
206
|
+
}</pre>
|
207
|
+
</div>
|
208
|
+
|
209
|
+
<p>What if the Withdraw() method throws another exception? Should we execute a compensating transaction in the catch block or rely on our transaction manager to restore the state of the objects? We need to answer those questions at some point, but not now; but what do we do with the failing test in the meantime � remove it? A better way is to temporarily ignore it, add the following attribute to your test method</p>
|
210
|
+
|
211
|
+
<div class="code">
|
212
|
+
<pre>[Test]
|
213
|
+
[Ignore("Decide how to implement transaction management")]
|
214
|
+
public void TransferWithInsufficientFundsAtomicity()
|
215
|
+
{
|
216
|
+
// code is the same
|
217
|
+
}</pre>
|
218
|
+
</div>
|
219
|
+
|
220
|
+
<p>Compile and run � yellow bar. Click on �Tests Not Run� tab and you will see bank.AccountTest.TransferWithInsufficientFundsAtomicity() in the list along with the Reason this test is ignored.</p>
|
221
|
+
|
222
|
+
<p>Looking at our test code we can see that some refactoring is in order. All test methods share a common set of test objects. Let�s extract this initialization code into a setup method and reuse it in all of our tests. The refactored version of our test class looks like this:</p>
|
223
|
+
|
224
|
+
<div class="code">
|
225
|
+
<pre>namespace bank
|
226
|
+
{
|
227
|
+
using System;
|
228
|
+
using NUnit.Framework;
|
229
|
+
|
230
|
+
[TestFixture]
|
231
|
+
public class AccountTest
|
232
|
+
{
|
233
|
+
Account source;
|
234
|
+
Account destination;
|
235
|
+
|
236
|
+
[SetUp]
|
237
|
+
public void Init()
|
238
|
+
{
|
239
|
+
source = new Account();
|
240
|
+
source.Deposit(200.00F);
|
241
|
+
destination = new Account();
|
242
|
+
destination.Deposit(150.00F);
|
243
|
+
}
|
244
|
+
|
245
|
+
[Test]
|
246
|
+
public void TransferFunds()
|
247
|
+
{
|
248
|
+
source.TransferFunds(destination, 100.00f);
|
249
|
+
Assert.AreEqual(250.00F, destination.Balance);
|
250
|
+
Assert.AreEqual(100.00F, source.Balance);
|
251
|
+
}
|
252
|
+
|
253
|
+
[Test]
|
254
|
+
[ExpectedException(typeof(InsufficientFundsException))]
|
255
|
+
public void TransferWithInsufficientFunds()
|
256
|
+
{
|
257
|
+
source.TransferFunds(destination, 300.00F);
|
258
|
+
}
|
259
|
+
|
260
|
+
[Test]
|
261
|
+
[Ignore("Decide how to implement transaction management")]
|
262
|
+
public void TransferWithInsufficientFundsAtomicity()
|
263
|
+
{
|
264
|
+
try
|
265
|
+
{
|
266
|
+
source.TransferFunds(destination, 300.00F);
|
267
|
+
}
|
268
|
+
catch(InsufficientFundsException expected)
|
269
|
+
{
|
270
|
+
}
|
271
|
+
|
272
|
+
Assert.AreEqual(200.00F,source.Balance);
|
273
|
+
Assert.AreEqual(150.00F,destination.Balance);
|
274
|
+
}
|
275
|
+
}
|
276
|
+
}</pre>
|
277
|
+
</div>
|
278
|
+
|
279
|
+
<p>Note that Init method has the common initialization code, it has void return type, no parameters, and it is marked with [SetUp] attribute. Compile and run � same yellow bar!</p>
|
280
|
+
|
281
|
+
</div>
|
282
|
+
|
283
|
+
<!-- Submenu -->
|
284
|
+
<div id="subnav">
|
285
|
+
<ul>
|
286
|
+
<li><a href="index.html">NUnit 2.4.8</a></li>
|
287
|
+
<ul>
|
288
|
+
<li><a href="getStarted.html">Getting Started</a></li>
|
289
|
+
<ul>
|
290
|
+
<li id="current"><a href="quickStart.html">Quick Start</a></li>
|
291
|
+
<li><a href="installation.html">Installation</a></li>
|
292
|
+
</ul>
|
293
|
+
<li><a href="assertions.html">Assertions</a></li>
|
294
|
+
<li><a href="attributes.html">Attributes</a></li>
|
295
|
+
<li><a href="nunit-console.html">Console Runner</a></li>
|
296
|
+
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
297
|
+
<li><a href="features.html">Other Features</a></li>
|
298
|
+
<li><a href="releaseNotes.html">Release Notes</a></li>
|
299
|
+
<li><a href="samples.html">Samples</a></li>
|
300
|
+
<li><a href="license.html">License</a></li>
|
301
|
+
</ul>
|
302
|
+
</ul>
|
303
|
+
</div>
|
304
|
+
<!-- End of Submenu -->
|
305
|
+
|
306
|
+
|
307
|
+
<!-- Standard Footer for NUnit.org -->
|
308
|
+
<div id="footer">
|
309
|
+
Copyright © 2008 Charlie Poole. All Rights Reserved.
|
310
|
+
</div>
|
311
|
+
<!-- End of Footer -->
|
312
|
+
|
313
|
+
</body>
|
314
|
+
</html>
|
@@ -0,0 +1,1235 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
2
|
+
<html>
|
3
|
+
<!-- Standard Head Part -->
|
4
|
+
<head>
|
5
|
+
<title>NUnit - ReleaseNotes</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
|
+
<style><!--
|
28
|
+
li { padding-bottom: .5em; }
|
29
|
+
ul ul li { padding-bottom: 0; }
|
30
|
+
dt { font-weight: bold }
|
31
|
+
--></style>
|
32
|
+
|
33
|
+
<h2>Release Notes</h2>
|
34
|
+
|
35
|
+
<h3>NUnit 2.4.8 - July 21, 2008</h3>
|
36
|
+
|
37
|
+
<h4>General</h4>
|
38
|
+
|
39
|
+
<ul>
|
40
|
+
<li>NUnit is now built using NAnt 0.86 beta 1
|
41
|
+
</ul>
|
42
|
+
|
43
|
+
<h4>Framework</h4>
|
44
|
+
|
45
|
+
<ul>
|
46
|
+
<li><b>PlatformAttribute</b> has been extended to accept the new keywords
|
47
|
+
<b>NT6</b>, <b>Vista</b> and <b>Win2008Server</b>.
|
48
|
+
<br><br>
|
49
|
+
<b>Note:</b> In the current release, NUnit is still unable to
|
50
|
+
distintuish between Vista and Windows 2008 Server. Either
|
51
|
+
of them will match all the above values. This problem will
|
52
|
+
be addressed in the 2.5 release.
|
53
|
+
</ul>
|
54
|
+
|
55
|
+
<h4>Bug Fixes</h4>
|
56
|
+
|
57
|
+
<ul>
|
58
|
+
<li>The Gui output panes were failing to use a fixed font.
|
59
|
+
<li>An NUnitSettings.xml file of zero length was causing a crash.
|
60
|
+
<li>Invoking the gui with /exclude:XXX, where XXX is a non-existent
|
61
|
+
category, was causing all tests to be excluded.
|
62
|
+
<li>Categories were not working properly on repeated tests.
|
63
|
+
<li>A serious memory leak was fixed in the NUnit test runners.
|
64
|
+
<li>Addins now work with the console runner.
|
65
|
+
</ul>
|
66
|
+
<h3>NUnit 2.4.7 - March 30, 2008</h3>
|
67
|
+
|
68
|
+
<h4>General</h4>
|
69
|
+
|
70
|
+
<ul>
|
71
|
+
<li>NUnit no longer uses log4net for its internal logging,
|
72
|
+
eliminating conflicts with tested applications that used
|
73
|
+
an earlier version of log4net.
|
74
|
+
</ul>
|
75
|
+
|
76
|
+
<h4>Gui</h4>
|
77
|
+
|
78
|
+
<ul>
|
79
|
+
<li>The level of logging sent to the gui for display is
|
80
|
+
now controlled by a setting in the config file for each
|
81
|
+
test. If no setting is provided, the default value is Error.
|
82
|
+
See the NUnitTests.config file for an example of how to set this.
|
83
|
+
</ul>
|
84
|
+
|
85
|
+
<h4>Extensibility</h4>
|
86
|
+
<ul>
|
87
|
+
<li>NUnit now includes the <b>RowTest</b> extension, written by
|
88
|
+
Andreas Schlapsi, in it's extension assemblies. This extension
|
89
|
+
allows you to write
|
90
|
+
test methods that take arguments and to provide multiple sets
|
91
|
+
of argument values using the <b>RowAttribute</b>. To use <b>RowTest</b>,
|
92
|
+
your test must reference the nunit.framework.extensions assembly.
|
93
|
+
<br><br>
|
94
|
+
<b>Note:</b> Merging extensions into NUnit's own extension assembly
|
95
|
+
is an experiment we are trying for this release. The approach may
|
96
|
+
change in future releases.
|
97
|
+
</ul>
|
98
|
+
|
99
|
+
<h4>Bug Fixes</h4>
|
100
|
+
|
101
|
+
<ul>
|
102
|
+
<li>Fixed null reference exception in SimpleSettingsDialog
|
103
|
+
<li>String equality comparisons now use Equals rather than
|
104
|
+
String.Compare, which was causing some unexpected results.
|
105
|
+
<li>Fixed a race condition in the EventPump
|
106
|
+
<li>Exceptions in Dispose are now handled properly
|
107
|
+
<li>Projects in directories for which the user does not
|
108
|
+
have write access are closed correctly.
|
109
|
+
<li>The Reload command is now disabled when no project
|
110
|
+
is open, eliminating a crashing problem.
|
111
|
+
<li>Visual Studio projects with platforms other than
|
112
|
+
Any CPU may now be opened correctly.
|
113
|
+
<li>Assemblies located on a UNC path now load correctly
|
114
|
+
<li>The EventListeners extension point is correctly initialized
|
115
|
+
<li>Has.None no longer causes a null reference exception
|
116
|
+
<li>Use of log4net for internal logging has been eliminated
|
117
|
+
due to performance and compatibility problems.
|
118
|
+
</ul>
|
119
|
+
<h3>NUnit 2.4.6 - December 31, 2007</h3>
|
120
|
+
|
121
|
+
<h4>Framework</h4>
|
122
|
+
|
123
|
+
<ul>
|
124
|
+
<li><b>CollectionAssert</b> has been modified to work with instances
|
125
|
+
of <b>IEnumerable</b> even if they are not true collections.
|
126
|
+
<li>All attributes are now unsealed and attributes that derive
|
127
|
+
from them will now be recognized by NUnit. For example, if you
|
128
|
+
derive SpecAttribute from TestAttribute, you may use [Spec] to
|
129
|
+
designate test methods without writing an extension. Note that
|
130
|
+
you will still need to create an extension if you want to
|
131
|
+
introduce any new behavior.
|
132
|
+
</ul>
|
133
|
+
|
134
|
+
<h4>Console</h4>
|
135
|
+
|
136
|
+
<ul>
|
137
|
+
<li>The new <b>/run</b> commandline option may be used to execute any
|
138
|
+
test method, class or namespace. Unlike the <b>/fixture</b> option,
|
139
|
+
it does not restrict classes that are loaded into memory so
|
140
|
+
it works properly with assemblies containing <b>SetUpFixture</b>.
|
141
|
+
This option should generally be preferred to the <b>/fixture</b>
|
142
|
+
option for new work.
|
143
|
+
<li>The console runner now allows combining categories through
|
144
|
+
use of boolean expressions. For example, <b>/include:Long+Data</b>
|
145
|
+
will run all tests that have both of the categories Long and Data
|
146
|
+
applied to them.
|
147
|
+
</ul>
|
148
|
+
|
149
|
+
<h4>Gui</h4>
|
150
|
+
|
151
|
+
<ul>
|
152
|
+
<li>When a test run has errors, the first one is now automatically selected
|
153
|
+
at the end of the run.
|
154
|
+
<li>Error messages have been reformatted so that the user message or expected
|
155
|
+
value display starts a new line.
|
156
|
+
<li>Extra leadin spaces have been removed from the stack trace display.
|
157
|
+
<li>A new command-line option <b>/runselected</b> causes the gui to run the last
|
158
|
+
remembered test selection. If no selection information has been saved for
|
159
|
+
the project, then all tests are run.
|
160
|
+
</ul>
|
161
|
+
|
162
|
+
<h4>Extensibility</h4>
|
163
|
+
|
164
|
+
<ul>
|
165
|
+
<li>The NUnit web site now includes a <a href="http://nunit.com/?p=extensions">directory</a>
|
166
|
+
of published extensions to NUnit. The initial release of the site includes
|
167
|
+
only a few items but will continue to expand as we receive and review extensions
|
168
|
+
from contributors.
|
169
|
+
|
170
|
+
</ul>
|
171
|
+
|
172
|
+
<h4>Bug Fixes</h4>
|
173
|
+
|
174
|
+
<ul>
|
175
|
+
<li>NUnit-console now shows a stack trace when the TestFixtureSetUp fails or
|
176
|
+
if the fixture constructor throws an exception.
|
177
|
+
<li>The Enable Shadow Copy checkbox in the options dialog now functions
|
178
|
+
correctly.
|
179
|
+
<li>Automatic rerun no longer takes place when a run is already in progress.
|
180
|
+
<li>Logging is commented out in the config file since the entries must
|
181
|
+
be tailored for certain installations to avoid exceptions.
|
182
|
+
<li>Non-assembly files in the addins directory no longer cause the
|
183
|
+
loading of addins to fail.
|
184
|
+
<li>The selection of Mini versus Full Gui displays in the options dialog
|
185
|
+
now works correctly.
|
186
|
+
<li>The status bar is no longer displayed for the Mini Gui.
|
187
|
+
<li>Help text, which was formerly available in the options dialog,
|
188
|
+
has now been restored.
|
189
|
+
</ul>
|
190
|
+
<h3>NUnit 2.4.5 - November 23, 2007</h3>
|
191
|
+
|
192
|
+
<h4>Bug Fixes</h4>
|
193
|
+
|
194
|
+
<ul>
|
195
|
+
<li>The included log4net dll has been replaced with a version that works on all runtime platforms.
|
196
|
+
<li>CollectionConstraint no longer confuses expected and actual counts
|
197
|
+
<li>Radio buttons on the TestLoader settings page now work correctly
|
198
|
+
<li>The MaxTimeTestDecorator sample has been fixed so that test attributes are recogized
|
199
|
+
<li>Invalid data in the Settings file, no longer causes an exception
|
200
|
+
<li>Documentation has been corrected in several places and missing files added
|
201
|
+
</ul>
|
202
|
+
<h3>NUnit 2.4.4 - October 20, 2007</h3>
|
203
|
+
|
204
|
+
<h4>General</h4>
|
205
|
+
|
206
|
+
<ul>
|
207
|
+
<li>NUnit now uses log4net rather than Trace for its own internal logging. If
|
208
|
+
enabled by the NUnit config files, log entries are saved in the file NUnit.log
|
209
|
+
located in the Application Data directory.
|
210
|
+
<br><br>
|
211
|
+
<b>Note:</b> Using the supplied config file, log4net currently fails to create
|
212
|
+
the log file when running under Mono on Windows platforms. As a workaround, you
|
213
|
+
may edit the configs to use a hardcoded path in place of the $(APPDATA) macro.
|
214
|
+
</ul>
|
215
|
+
|
216
|
+
<h4>Framework</h4>
|
217
|
+
|
218
|
+
<ul>
|
219
|
+
<li>A suite marked with the SuiteAttribute is now permitted to return a collection
|
220
|
+
of fixture objects or Types, rather than a TestSuite. This eliminates the need
|
221
|
+
for the tests to reference the nunit.core assembly.
|
222
|
+
<li>Classes containing suites may now use the TestFixtureSetUp and TestFixtureTearDown
|
223
|
+
attributes to decorate methods to be called for one-time setup and teardown.
|
224
|
+
<br><br>
|
225
|
+
<b>Note:</b> This feature has actually been in place since the 2.4 release, but
|
226
|
+
was not previously reported in the release notes.
|
227
|
+
|
228
|
+
<li>It is now possible to specify a TimeSpan as a tolerance when comparing
|
229
|
+
two DateTime objects for equality.
|
230
|
+
|
231
|
+
<li>Tests may now set a default tolerance for floating point comparisons may now
|
232
|
+
be set using <b>GlobalSettings.DefaultFloatingPointTolerance</b>. If not set, a
|
233
|
+
tolerance of 0.0d is used for backward compatibility.
|
234
|
+
|
235
|
+
<li>String comparison failures now show more context than before, using the
|
236
|
+
full width of the message line. The length of the message line defaults to 78
|
237
|
+
but may be changed by setting <b>TextMessageWriter.MaxLineLength</b>. Set it to an
|
238
|
+
arbitrarily high value to avoid all string truncation. Use the <b>NoClip</b>
|
239
|
+
modifier on an equality constraint to prevent clipping on an individual
|
240
|
+
assert.
|
241
|
+
</ul>
|
242
|
+
|
243
|
+
<h4>Gui</h4>
|
244
|
+
|
245
|
+
<ul>
|
246
|
+
<li>Cosmetic changes have been made to the main Gui window and the tabbed Options
|
247
|
+
dialog has been replaced with a tree-based dialog in order to allow more
|
248
|
+
opportunity for expanded options.
|
249
|
+
|
250
|
+
<li>User logging through log4net is captured and displayed by the Gui.
|
251
|
+
|
252
|
+
<li>A new Test Output Options pane allows controlling exactly what appears in
|
253
|
+
each text window. By default, NUnit uses four tabs: StdOut, StdErr, Trace and
|
254
|
+
Log, but the user may remove, create or combine tabs as desired.
|
255
|
+
|
256
|
+
<li>A new command-line option <b>/console</b> causes a console to be
|
257
|
+
allocated. This should be used when testing applications that used unmanaged
|
258
|
+
APIs to write to stdout, since NUnit is not able to capture that output.
|
259
|
+
</ul>
|
260
|
+
|
261
|
+
<h4>Extensibility</h4>
|
262
|
+
|
263
|
+
<ul>
|
264
|
+
|
265
|
+
<li>A new <b>ExtensionPoint</b> has been added. The <b>Listeners</b> extension
|
266
|
+
point allows an addin to install an <b>EventListener</b> in the test domain,
|
267
|
+
which is called as the tests are run. Note that the call is asynchronous and
|
268
|
+
therefore may not be used to control the running of the tests, but only to
|
269
|
+
report information or take other action based on the events.
|
270
|
+
|
271
|
+
<li>The implementation of NUnitTestFixture has been modified so that
|
272
|
+
it is now possible to write a TestCaseBuilder addin, which will replace
|
273
|
+
or enhance the builtin creation of TestCases.
|
274
|
+
|
275
|
+
</ul>
|
276
|
+
|
277
|
+
<h4>Bug Fixes</h4>
|
278
|
+
|
279
|
+
<ul>
|
280
|
+
<li>The ability to select and copy text from the text output windows, which
|
281
|
+
was unintentionally dropped in NUnit 2.4.3, has been restored.
|
282
|
+
<li>The programs nunit-console-x86.exe and nunit-x86.exe are now being installed
|
283
|
+
correctly by the .NET 2.0 Windows installer package.
|
284
|
+
<li>Checked tests are now ignored when the checkboxes are hidden.
|
285
|
+
<li>Fixed a problem loading assemblies with multiple # characters in the path
|
286
|
+
<li>Tests are no longer executed twice with certain combinations of reload/rerun settings
|
287
|
+
<li>Obsolete /framework option is no longer displayed by the console runner help
|
288
|
+
<li>The console runner now accepts both /include and /exclude options
|
289
|
+
<li>The Gui "loading" and "reloading" notices are now sized correctly under Mono
|
290
|
+
<li>Trace output, which was disabled in 2.4.3, is now displayed correctly.
|
291
|
+
<li>The exception message is now displayed when the wrong exception type is received from a testcase marked with ExpectedException
|
292
|
+
<li>The EmptyCollection constraint now throws an exception if applied to a null reference rather than returning false
|
293
|
+
<li>Reloading a single assembly no longer changes the config file name
|
294
|
+
<li>Changing options without a loaded project no longer gives an exception
|
295
|
+
<li>The Show Checkboxes entry on the tree context menu now works correctly.
|
296
|
+
<li>All levels of teardown now run when an exception is thrown
|
297
|
+
</ul>
|
298
|
+
<h3>NUnit 2.4.3 - August 16, 2007</h3>
|
299
|
+
|
300
|
+
<h4>General</h4>
|
301
|
+
<ul>
|
302
|
+
<li>Mono compatibility is significantly improved. The Gui runs under Mono
|
303
|
+
1.2.2. A number of tests, which were previously skipped under Mono, are now
|
304
|
+
executed successfully. See the
|
305
|
+
<a href="http://nunit.com/platformSupport.html">Platform Support</a>
|
306
|
+
page on the website for more information.
|
307
|
+
|
308
|
+
<li>Documentation is now available as a separate download.
|
309
|
+
</ul>
|
310
|
+
|
311
|
+
<h4>Console Runner</h4>
|
312
|
+
|
313
|
+
<ul>
|
314
|
+
<li>The console runner now uses negative return codes for errors encountered
|
315
|
+
in trying to run the test.
|
316
|
+
Failures or errors in the test themselves give a positive return
|
317
|
+
code equal to the number of such failures or errors.
|
318
|
+
|
319
|
+
</ul>
|
320
|
+
|
321
|
+
<h4>Bug Fixes</h4>
|
322
|
+
|
323
|
+
<ul>
|
324
|
+
<li>Comparisons between numeric values of various types now work correctly (see note).
|
325
|
+
|
326
|
+
<li>Fixed crashing problems running the Gui under .NET 1.0. and Mono.
|
327
|
+
|
328
|
+
<li>Fixed several problems when the new Load Fixture facility of the Gui:
|
329
|
+
<ul>
|
330
|
+
<li>An exception is no longer thrown when using it with multiple AppDomains.
|
331
|
+
<li>The Load Fixture menu item is no longer enabled for the top-level node.
|
332
|
+
<li>Assemblies within a test project now load without error.
|
333
|
+
<li>The full namespace hierarchy is now shown when loading a TestFixture.
|
334
|
+
</ul>
|
335
|
+
|
336
|
+
<li>Fixed incorrect implementation of CollectionAssert.AreEquivalent and
|
337
|
+
CollectionAssert.IsEqualTo so that the number of occurences of an object
|
338
|
+
in a collection is properly taken into account (see note).
|
339
|
+
<br><br>
|
340
|
+
<b>Note:</b> Several of these fixes may cause failures of tests, which
|
341
|
+
had appeared to pass. In most cases, the passing tests were probably
|
342
|
+
false positives.
|
343
|
+
|
344
|
+
</ul>
|
345
|
+
<h3>NUnit 2.4.2 - August 2, 2007</h3>
|
346
|
+
|
347
|
+
<h4>General</h4>
|
348
|
+
<ul>
|
349
|
+
<li>The .Net 2.0 packages now include nunit-x86.exe and nunit-console-x86.exe,
|
350
|
+
which may be used to test 32-bit code on 64-bit systems.
|
351
|
+
</ul>
|
352
|
+
|
353
|
+
<h4>Framework</h4>
|
354
|
+
<ul>
|
355
|
+
<li>Numeric comparison is now performed by converting the expected and actual
|
356
|
+
values to the widest of the two types rather than by comparing the string
|
357
|
+
representation of the two values. This eliminates certain problems with
|
358
|
+
decimals and floats and is more representative of how the comparison would
|
359
|
+
be performed in most programming languages.
|
360
|
+
|
361
|
+
<li>Two new attributes allow tailoring the tests for different cultures
|
362
|
+
<dl style="margin-left: 2em">
|
363
|
+
<dt>CultureAttribute
|
364
|
+
<dd>Allows you to specify the cultures under which a test should be
|
365
|
+
run or skipped. It works just like PlatformAttribute, supporting named
|
366
|
+
parameters Include, Exclude and Reason. You can use local cultures ("en-GB")
|
367
|
+
or neutral cultures ("en"). It may be used on tests, fixtures or assemblies.
|
368
|
+
<dt>SetCultureAttribute
|
369
|
+
<dd>Changes the culture for the duration of the test. As of this release,
|
370
|
+
only a single culture may be specified, so you will need to create a separate
|
371
|
+
test method for each culture under which you want ta test to be run.
|
372
|
+
</dl>
|
373
|
+
|
374
|
+
<li>Expected and actual value messages created by NUnit now use the InvariantCulture
|
375
|
+
in formatting numeric values. DateTime values are formatted as "yyyy-MM-dd HH:mm:ss.fff".
|
376
|
+
|
377
|
+
<li>A number of changes have been made to the constraint-based Assert syntax
|
378
|
+
introduced in version 2.4:
|
379
|
+
<dl style="margin-left: 2em">
|
380
|
+
<dt>EqualTo(...).Within(...)
|
381
|
+
<dd>A tolerance may be specified
|
382
|
+
for any numeric type and works as expected. The value specified as a tolerance
|
383
|
+
must be convertible to the type used in the comparison or an exception will
|
384
|
+
be thrown.
|
385
|
+
|
386
|
+
<dt>Collection Asserts
|
387
|
+
<dd>Asserts that require a collection as the actual value now throw an exception
|
388
|
+
if the value is not a collection. In earlier releases, the test failed, which
|
389
|
+
caused false positives when it was modified by Not.
|
390
|
+
|
391
|
+
<dt>Syntax Helpers
|
392
|
+
<dd>NUnit 2.4.1 provided four SyntaxHelpers: Is, List, Text and the
|
393
|
+
undocumented Has helper. In 2.4.2, there are three helpers, with the List
|
394
|
+
class now being used for mapping collections as describe below.
|
395
|
+
|
396
|
+
Rather than inheriting from a common base containing properties like Not and
|
397
|
+
All, each SyntaxHelper now implements only specific properties.
|
398
|
+
<ul>
|
399
|
+
<li><b>Is</b> defines the large majority of constraint tests. Since it is
|
400
|
+
a keyword in Visual Basic, the synonym <b>Iz</b> is provided for VB users.
|
401
|
+
Constraint operators <b>Is.All</b> and <b>Is.Not</b> are supported.
|
402
|
+
<li><b>Text</b> defines constraints that are specific to strings.
|
403
|
+
Constraint operator <b>Is.All</b> is supported as well.
|
404
|
+
<li><b>Has</b> is newly documented and extended in 2.4.2. It is used to make
|
405
|
+
tests on members of collections, elements of arrays, entries in dictionaries
|
406
|
+
and properties of objects. Operators <b>Has.No</b>, <b>Has.All</b>,
|
407
|
+
<b>Has.Some</b> and <b>Has.None</b> are supported.
|
408
|
+
<li><b>List.Contains()</b> has been replaced by <b>Has.Member()</b>.
|
409
|
+
</ul>
|
410
|
+
|
411
|
+
<dt>List.Map
|
412
|
+
<dd>Used to map a collection provided as an actual value to another collection
|
413
|
+
to which constraints are then applied. Currently supports creating a list
|
414
|
+
of the values of a given property. See the documentation for details.
|
415
|
+
</dl>
|
416
|
+
|
417
|
+
<li>The <b>IConstraint</b> interface has been removed. Custom constraint
|
418
|
+
classes should inherit from the <b>Constraint</b> abstract class.
|
419
|
+
|
420
|
+
</ul>
|
421
|
+
|
422
|
+
<h4>Core</h4>
|
423
|
+
<ul>
|
424
|
+
<li>When tests in an NUnit project are run in multiple AppDomains, any non-default
|
425
|
+
values set for AppBase, PrivateBinPath and Configuration File are now honored for
|
426
|
+
each separate assembly. If values are not provided, the default is to use the
|
427
|
+
location of each assembly together with any config file with the name of the
|
428
|
+
assembly plus the ".config" extension. When running in a single AppDomain, the
|
429
|
+
existing defaults are unchanged.
|
430
|
+
|
431
|
+
<li>Any changes to the current directory or current culture made during a test
|
432
|
+
are now restored at the end of the test. For example, if you set the culture
|
433
|
+
with code in your TestFixtureSetUp, that change will remain in place until
|
434
|
+
all tests are run and the TestFixtureTearDown completes. At that point, the
|
435
|
+
value will be restored to what it was before.
|
436
|
+
</ul>
|
437
|
+
|
438
|
+
<h4>Gui</h4>
|
439
|
+
|
440
|
+
<ul>
|
441
|
+
<li>The main window is activated whenever a test run has failures. This causes
|
442
|
+
NUnit's taskbar button to be highlighted if the window is minimized or hidden.
|
443
|
+
|
444
|
+
<li>The reload menu item is now called Reload Tests. It continues to work as
|
445
|
+
before, causing any changes in the assemblies to be merged into the tree. A new
|
446
|
+
menu item, Reload Project, does a complete load by closing the project and
|
447
|
+
reopening it as if the user had done so through the Open menu item.
|
448
|
+
|
449
|
+
<li>Separate recent file lists are maintained, one for running under .NET 2.0
|
450
|
+
and one for earlier versions of the runtime. This useful for developers who work
|
451
|
+
on multiple projects as well as those who maintain configurations for different
|
452
|
+
runtimes in the same project file.
|
453
|
+
|
454
|
+
<li>The tree context menu contains an entry to load the selected fixture alone.
|
455
|
+
Developers working on large projects can reduce reloading time significantly
|
456
|
+
by using this feature to load only a subset of the tests. A separate context
|
457
|
+
menu item is used to reload the full project.
|
458
|
+
|
459
|
+
<b>Note:</b> This feature is a quick and dirty solution to the problem
|
460
|
+
of reload time. It is limited to a single selected item because that's
|
461
|
+
what the underlying test loader currently supports. Future releases will
|
462
|
+
deal with this in an entirely different way.
|
463
|
+
|
464
|
+
<li>The Gui can now save and restore the visual state of the tree when a
|
465
|
+
project is closed and restores it on open. The following items are saved:
|
466
|
+
<ul>
|
467
|
+
<li>Whether checkboxes are shown
|
468
|
+
<li>The topmost visible node
|
469
|
+
<li>The selected node
|
470
|
+
<li>Which nodes are expanded or collapsed
|
471
|
+
<li>Which nodes are checked
|
472
|
+
<li>Which categories are selected
|
473
|
+
</ul>
|
474
|
+
This is controlled by a selection on the Options Dialog.
|
475
|
+
|
476
|
+
<b>Note:</b> TopNode is restored correctly under .NET 2.0. Under .NET 1.1
|
477
|
+
the node is made visible but may not be at the top of the display.
|
478
|
+
|
479
|
+
<li>A summary of the last test run is shown below the progress bar. This
|
480
|
+
information remains displayed even when the information in the status
|
481
|
+
bar changes.
|
482
|
+
|
483
|
+
<li>The Gui now remembers the last result tab selected.
|
484
|
+
|
485
|
+
<li>The Project Editor now displays a confirmation box when you attempt
|
486
|
+
to delete an assembly from the project.
|
487
|
+
|
488
|
+
<li>If you change settings in the Options Dialog, which require a reload
|
489
|
+
in order to take effect, a message box gives you the opportunity to
|
490
|
+
reload the project immediately.
|
491
|
+
|
492
|
+
<li>If you change the active configuration - as from Debug to Release - and
|
493
|
+
the new config can not be loaded, the old configuration is unloaded. In prior
|
494
|
+
releases, the old config remained loaded even though the new config was
|
495
|
+
marked as active.
|
496
|
+
|
497
|
+
<li>The "Reloading..." message is now displayed when automatic reloading
|
498
|
+
takes place.
|
499
|
+
</ul>
|
500
|
+
|
501
|
+
<h4>Bug Fixes</h4>
|
502
|
+
<ul>
|
503
|
+
<li>A comparer passed to CollectionAssert.AreEqual is now used
|
504
|
+
<li>An error message is now displayed if the test result file can not be written
|
505
|
+
<li>AbstractTestCaseDecoration no longer duplicates the fixture name
|
506
|
+
<li>Renamed and deleted tests are now correctly removed from the Gui display
|
507
|
+
<li>The internally used create-msi target is no longer displayed by the project help for NUnit.build
|
508
|
+
<li>TipWindow no longer gives an IndexOutOfRangeException in certain situations
|
509
|
+
<li>Failures are now reported correctly when running multiple assemblies in separate AppDomains
|
510
|
+
<li>Recent file names containing a comma no longer cause an exception
|
511
|
+
<li>Is.EqualTo(x).Within(y) now works correctly for floats
|
512
|
+
<li>TestFixtureTearDown was not being called on fixtures marked as Explicit
|
513
|
+
<li>Exclude checkbox in Gui is now cleared when all categories are removed
|
514
|
+
<li>Tab order in the properties dialog has been corrected
|
515
|
+
<li>The install files are now included in the source package
|
516
|
+
</ul>
|
517
|
+
<h3>NUnit 2.4.1 - May 3, 2007</h3>
|
518
|
+
|
519
|
+
<h4>General</h4>
|
520
|
+
|
521
|
+
<ul>
|
522
|
+
<li>When the NUnit help is not installed, the Help menu item now displays the
|
523
|
+
documentation from the NUnit web site.
|
524
|
+
</ul>
|
525
|
+
|
526
|
+
<h4>Framework</h4>
|
527
|
+
|
528
|
+
<ul>
|
529
|
+
<li>The following Assert overloads have been added
|
530
|
+
<dl style="margin-left: 2em">
|
531
|
+
<dt>Assert.Greater(long, long)
|
532
|
+
<dt>Assert.Greater(ulong, ulong)
|
533
|
+
<dt>Assert.GreaterOrEqual(long, long)
|
534
|
+
<dt>Assert.GreaterOrEqual(ulong, ulong)
|
535
|
+
<dt>Assert.Less(long, long)
|
536
|
+
<dt>Assert.Less(ulong, ulong)
|
537
|
+
<dt>Assert.LessOrEqual(long, long)
|
538
|
+
<dt>Assert.LessOrEqual(ulong, ulong)
|
539
|
+
</dl>
|
540
|
+
</ul>
|
541
|
+
|
542
|
+
<h4>Gui</h4>
|
543
|
+
|
544
|
+
<ul>
|
545
|
+
<li>When a load or reload is in progress, an indicator message is now
|
546
|
+
displayed, centered on top of the form. The form is now displayed
|
547
|
+
earlier in the startup sequence so that error messages do not appear
|
548
|
+
in isolation.
|
549
|
+
|
550
|
+
<li>When a non-existent assembly is specified on the command line, the
|
551
|
+
gui no longer closes after the error message is dismissed.
|
552
|
+
|
553
|
+
<li>When the option to re-run tests when assembly changes is selected,
|
554
|
+
the last set of tests run is now re-run, rather than running all tests.
|
555
|
+
|
556
|
+
<li>The failure message for tests failing due to a problem with the
|
557
|
+
TestFixtureSetUp now indicate the name of the failing fixture.
|
558
|
+
</ul>
|
559
|
+
|
560
|
+
<h4>Extensibility</h4>
|
561
|
+
<ul>
|
562
|
+
<li>The TestCase class has a new virtual method <b>MakeTestCaseResult()</b>,
|
563
|
+
allowing extensions to use a derived TestCaseResult if desired. Because
|
564
|
+
NUnit makes no use of additional properties or methods added to the
|
565
|
+
TestCaseResult, some sort of custom processing is required for this
|
566
|
+
feature to be useful. Extenders should be aware that inheriting from
|
567
|
+
TestCase currently makes the extension dependent on a particular version
|
568
|
+
of NUnit.
|
569
|
+
|
570
|
+
<li>A brief list of "Tips for Writing Extensions" has been added to the documentation.
|
571
|
+
</ul>
|
572
|
+
|
573
|
+
<h4>Bug Fixes</h4>
|
574
|
+
|
575
|
+
<ul>
|
576
|
+
<li>CollectionAsserts no longer fail on collections containig null values.
|
577
|
+
|
578
|
+
<li>The obsolete file, <b>nunit-gui.exe</b>, has been removed from the zip distribution.
|
579
|
+
|
580
|
+
<li>The errors and failures display now recalculates the space available and
|
581
|
+
enables or disables the scrollbar whenever it is resized.
|
582
|
+
|
583
|
+
<li>The xml file automatically saved by the Gui when a test is run is now
|
584
|
+
correctly named as TestResult.xml rather than TestTesult.xml.
|
585
|
+
|
586
|
+
<li>The <b>Explicit</b> attribute now works correctly when specified on
|
587
|
+
a test fixture.
|
588
|
+
|
589
|
+
<li>The /cleanup option no longer throws an exception when the shadow copy
|
590
|
+
cache directory is not present.
|
591
|
+
|
592
|
+
<li>The current directory is now set correctly when running a <b>SetUpFixture</b>.
|
593
|
+
|
594
|
+
<li>Non-default test load options are no longer ignored when loading tests in
|
595
|
+
multiple AppDomains.
|
596
|
+
|
597
|
+
<li>The Errors and Failures display is now re-drawn with the scroll bars
|
598
|
+
enabled/disabled as needed whenever it is resized.
|
599
|
+
|
600
|
+
<li>The MaxTimeDecorator example no longer shows the name of a test
|
601
|
+
case repeated twice in the full name of the test.
|
602
|
+
</ul>
|
603
|
+
<h3>NUnit 2.4 Final Release (2.4.0.2) - March 16, 2007</h3>
|
604
|
+
|
605
|
+
<h4>Gui</h4>
|
606
|
+
|
607
|
+
<ul>
|
608
|
+
<li>A new /cleanup commandline option deletes NUnit's shadow copy
|
609
|
+
cache and then exits.
|
610
|
+
|
611
|
+
<li>When NUnit is run under .Net 1.1, assemblies built with .Net 2.0
|
612
|
+
are not displayed in the recent files list. NUnit automatically loads
|
613
|
+
the last assembly that was opened under .Net 1.1.
|
614
|
+
<br><br>
|
615
|
+
<b>Note:</b> When a program built with .Net 1.1 is run under .Net 2.0,
|
616
|
+
it will not appear in the Recent Files list the next time NUnit is run
|
617
|
+
under .Net 1.1. This issue will be fixed in a future release.
|
618
|
+
|
619
|
+
<li>When the NUnit documentation is not installed, the Help menu item
|
620
|
+
now displays the NUnit web site.
|
621
|
+
</ul>
|
622
|
+
|
623
|
+
<h4>Bug Fixes</h4>
|
624
|
+
|
625
|
+
<ul>
|
626
|
+
<li>The user interface (NUnitForm.cs) was not properly displayed at
|
627
|
+
design time due to a problem with detecting DesignMode in nested
|
628
|
+
User Controls.
|
629
|
+
|
630
|
+
<li>CollectionConstraint was failing to find contained items in
|
631
|
+
a collection implementing ICollection only - that is not implementing
|
632
|
+
IList. This is now fixed and all collections use the same code path
|
633
|
+
to avoid future problems.
|
634
|
+
|
635
|
+
<li>The Tree setting "Show Checkboxes" was not being saved properly.
|
636
|
+
|
637
|
+
<li>Many of NUnit's own tests were leaving files in the shadow
|
638
|
+
copy cache due to not closing the test domain.
|
639
|
+
|
640
|
+
<li>NUnit was attempting to instantiate an abstract class, derived
|
641
|
+
from another abstract class marked with TestFixtureAttribute. NUnit
|
642
|
+
will now mark all abstract classes with this attribute, or inheriting
|
643
|
+
from classes with this attribute as non-runnable.
|
644
|
+
</ul>
|
645
|
+
|
646
|
+
<h3>NUnit 2.4 RC2 (2.4.0.1) - March 9, 2007</h3>
|
647
|
+
|
648
|
+
<h4>Framework</h4>
|
649
|
+
|
650
|
+
<ul>
|
651
|
+
<li>The Is class has been moved to the SyntaxHelpers namespace in order
|
652
|
+
to eliminate conflicts with mock object frameworks. Additional helper
|
653
|
+
classes <b>List</b>, <b>Has</b> and <b>Text</b> have been added.
|
654
|
+
<li>The <b>AssertionHelper</b> class has been added as an optional
|
655
|
+
base class for user fixtures. Use of this class as a base makes methods
|
656
|
+
available for creating constraints needing to use one of the helper
|
657
|
+
classes.
|
658
|
+
|
659
|
+
<li>A PropertyConstraint has been added, which allows testing the
|
660
|
+
value of one of an object's properties.
|
661
|
+
</ul>
|
662
|
+
|
663
|
+
<h3>NUnit 2.4 RC1 (2.4.0) - February 25, 2007</h3>
|
664
|
+
|
665
|
+
<h4>General</h4>
|
666
|
+
|
667
|
+
<ul>
|
668
|
+
<li>Two packages, built under the 1.1 and 2.0 runtimes, are provided
|
669
|
+
as before, but they are now mutually exclusive - only one may be installed.
|
670
|
+
By downloading the source, you can rebuild NUnit under other runtimes. See
|
671
|
+
the <a href="platformSupport.html">Platform Support</a> page for
|
672
|
+
details about the runtimes under which each each package may be run.
|
673
|
+
|
674
|
+
<li>If you build NUnit from source, you will notice that the full text
|
675
|
+
of the license is no longer included in every file. For easier maintenance, we
|
676
|
+
now put a short notice in the source files, which refers to the license.
|
677
|
+
|
678
|
+
<li>Fit tests are now provided. The tests supplied are fairly rudimentary,
|
679
|
+
but it's a start! The Fit assemblies required to run the tests are included
|
680
|
+
with the NUnit distribution. You can get a complete Fit download, including
|
681
|
+
source code, at the <a href="fit.c2.com">Fit website</a>.
|
682
|
+
|
683
|
+
<li>Samples are now organized by language and additional samples
|
684
|
+
have been provided. C++ samples are provided using both the VS2003
|
685
|
+
managed C++ syntax and the new C++/CLI syntax for VS2005. Solution files
|
686
|
+
group samples by language, with an additional solution for extensibility samples.
|
687
|
+
|
688
|
+
<li>The nunit.common assembly, added in the Alpha release, has been eliminated.
|
689
|
+
</ul>
|
690
|
+
|
691
|
+
<h4>Framework</h4>
|
692
|
+
|
693
|
+
<ul>
|
694
|
+
<li>A new syntax and internal architecture for Asserts is being introduced in
|
695
|
+
this release, based on the notion of <b>constraints</b> found in JMock and NMock.
|
696
|
+
<ul>
|
697
|
+
<li>The <b>Assert.That</b> method is used to make an assertion based on a
|
698
|
+
constraint
|
699
|
+
<dl style="margin-left: 2em">
|
700
|
+
<dt>Assert.That( actual, constraint, message, args );
|
701
|
+
<dt>Assert.That( actual, constraint, message );
|
702
|
+
<dt>Assert.That( actual, constraint );
|
703
|
+
</dl>
|
704
|
+
<li>The <b>constraint</b> argument may be specified directly using one of the
|
705
|
+
built-in constraint classes or a user-defined class.
|
706
|
+
<li>It may also be specified using one of the syntax helpers provided as
|
707
|
+
static methods of the <b>Is</b> class, such as
|
708
|
+
<dl style="margin-left: 2em">
|
709
|
+
<dt>Is.Null
|
710
|
+
<dt>Is.Empty
|
711
|
+
<dt>Is.EqualTo( object )
|
712
|
+
<dt>Is.CollectionContaining( object )
|
713
|
+
<dt>Is.SubsetOf( collection )
|
714
|
+
</dl>
|
715
|
+
See the docs for complete information.
|
716
|
+
<li>Internally, all the "classic" Assert methods, like AreEqual, have been
|
717
|
+
re-implemented using the underlying constraint architecture.
|
718
|
+
<li>The old approach to extending Asserts by creating <b>Asserter</b> classes
|
719
|
+
is now deprecated and the classes and interfaces are marked Obsolete.
|
720
|
+
</ul>
|
721
|
+
|
722
|
+
<li>A number of changes have been made to the <b>ExpectedException</b> attribute
|
723
|
+
<ul>
|
724
|
+
<li>Several constructors for <b>ExpectedExceptionAttribute</b> have
|
725
|
+
been removed and two are now marked obsolete. All functionality
|
726
|
+
continues to be available through the use of named parameters. See
|
727
|
+
the documentation for details.
|
728
|
+
|
729
|
+
<li>User-defined <b>ExceptionHandlers</b> are now supported:
|
730
|
+
<ul>
|
731
|
+
<li>A handler takes a <b>System.Exception</b> as an argument and returns void.
|
732
|
+
Normal Assert statements are used to validate the exception.
|
733
|
+
<li>A default handler may be specified for the fixture by implementing
|
734
|
+
the <b>IExpectException</b> interface.
|
735
|
+
<li>Individual test case handlers may be specified by use of the
|
736
|
+
<b>Handler</b> named parameter.
|
737
|
+
<li>The <b>ExpectedException</b> attribute may be used without
|
738
|
+
an exception type, leaving all validation to the <b>ExceptionHandler</b>.
|
739
|
+
</ul>
|
740
|
+
|
741
|
+
<li>A custom error message may be displayed by use of the <b>UserMessage</b>
|
742
|
+
named parameter.
|
743
|
+
</ul>
|
744
|
+
|
745
|
+
<li>The <b>StringAssert</b> class has a new <b>IsMatch</b> method
|
746
|
+
that does regular expression matching.
|
747
|
+
|
748
|
+
<li>The setup and teardown methods in a <b>SetUpFixture</b> are now
|
749
|
+
marked by the <b>SetUpAttribute</b> and <b>TearDownAttribute</b> rather
|
750
|
+
than the corresponding "Fixture" attributes used in earlier betas.
|
751
|
+
|
752
|
+
<li>NUnit now recognizes user-defined attributes derived from CategoryAttribute
|
753
|
+
and PropertyAttribute. Protected constructors are provided for use by derived classes:
|
754
|
+
<dl style="margin-left: 2em">
|
755
|
+
<dt>protected CategoryAttribute()
|
756
|
+
<dd>Creates a category with the same name as the derived class.
|
757
|
+
<dt>protected PropertyAttribute(object attributeValue)
|
758
|
+
<dd>Creates a property with the same name as the derived class.
|
759
|
+
</dl><br>
|
760
|
+
<b>Note:</b> Other attributes remain sealed, as in prior releases.
|
761
|
+
|
762
|
+
</ul>
|
763
|
+
|
764
|
+
<h4>Core</h4>
|
765
|
+
|
766
|
+
<ul>
|
767
|
+
|
768
|
+
<li>User settings are now stored in an XML file rather than the registry.
|
769
|
+
Any existing settings from NUnit 2.2 or from earlier betas are migrated on first use.
|
770
|
+
|
771
|
+
<li>Properties assigned to tests are now included in the XML output file.
|
772
|
+
|
773
|
+
<li>Internally, many classes which were previously defined as singletons are
|
774
|
+
now treated as services, managed by a ServiceManager.
|
775
|
+
|
776
|
+
</ul>
|
777
|
+
|
778
|
+
<h4>Console</h4>
|
779
|
+
<ul>
|
780
|
+
<li>The new <b>/domain</b> option controls of the creation of AppDomains for running tests.
|
781
|
+
The following values are recognized:
|
782
|
+
<dl style="margin-left: 2em">
|
783
|
+
<dt>None
|
784
|
+
<dd>No domain is created - the tests are run in the primary domain. This normally
|
785
|
+
requires copying the <b>NUnit</b> assemblies into the same directory as your tests.
|
786
|
+
<dt>Single
|
787
|
+
<dd>A test domain is created - this is how NUnit worked prior to version 2.4
|
788
|
+
<dt>Multiple
|
789
|
+
<dd>A separate test domain is created for each assembly
|
790
|
+
</dl>
|
791
|
+
The default is to use multiple domains if multiple assemblies are listed on
|
792
|
+
the command line. Otherwise a single domain is used.<br><br>
|
793
|
+
|
794
|
+
<li>The obsolete <b>/thread</b> option has been replaced by <b>/nothread</b>.
|
795
|
+
Since tests have been run on a separate thread by default for some time,
|
796
|
+
the old option had no effect.<br><br>
|
797
|
+
|
798
|
+
<b>Note:</b> Default use of a separate test thread is intended to isolate
|
799
|
+
NUnit from changes made to the thread context. Tests that change the context
|
800
|
+
and don't restore it should not be run using this option.
|
801
|
+
</ul>
|
802
|
+
|
803
|
+
<h4>Gui</h4>
|
804
|
+
|
805
|
+
<ul>
|
806
|
+
<li>The GUI command line now supports /include and /exclude options for
|
807
|
+
categories. Only one of the two may be used at a time. These options effect
|
808
|
+
the initial category selection in the GUI.
|
809
|
+
|
810
|
+
<li>The XML test results are now saved automatically in file <b>TestResult.xml</b>
|
811
|
+
at the end of each run.
|
812
|
+
|
813
|
+
<li>An option is provided to suppress shadow-copying of assemblies.
|
814
|
+
|
815
|
+
<li>The Test Properties dialog now displays properties assigned to a test.
|
816
|
+
The text fields for categories and properties have been replaced with listboxes.
|
817
|
+
|
818
|
+
<li>Trace output from tests is displayed in a tab in the GUI. Optionally,
|
819
|
+
trace and stderr output may be redirected to the Console output tab
|
820
|
+
|
821
|
+
<li>The position, size and font of the mini-Gui window are now saved separately
|
822
|
+
from the full-size window.
|
823
|
+
|
824
|
+
<li>Internally, the gui display has been refactored so so that the tab
|
825
|
+
display is provided by a separate control.
|
826
|
+
|
827
|
+
<li>The Windows install packages set up individual shortcuts for running under
|
828
|
+
each of the supported runtimes installed on your system. If additional supported
|
829
|
+
runtimes are installed, you can create similar shortcuts yourself or reinstall
|
830
|
+
NUnit to have them created automatically.
|
831
|
+
|
832
|
+
</ul>
|
833
|
+
|
834
|
+
<h3>NUnit 2.4 Beta 2 Release (2.3.6293) - October 20, 2006</h3>
|
835
|
+
|
836
|
+
<h4>General</h4>
|
837
|
+
|
838
|
+
<ul>
|
839
|
+
<li>A new assembly, <b>nunit.core.interfaces</b>, is being introduced in this release.
|
840
|
+
This assembly holds interfaces, enumerations and data types that are intended
|
841
|
+
for external use - for example, by client code that executes NUnit tests. Our
|
842
|
+
intent is to hold the version number of this assembly constant through all
|
843
|
+
NUnit 2.4 maintenance releases and to avoid any breaking changes in this code.
|
844
|
+
|
845
|
+
<li>The Windows installer is now built using WiX. With the removal of
|
846
|
+
the Visual Studio deployment project from the VS2005 solution, it is
|
847
|
+
now possible to build NUnit completely using C# Express.
|
848
|
+
|
849
|
+
<li>The nunit.framework assembly is no longer installed in the GAC.
|
850
|
+
|
851
|
+
</ul>
|
852
|
+
|
853
|
+
<h4>Framework</h4>
|
854
|
+
<ul>
|
855
|
+
<li>The AreEqual and AreNotEqual asserts have been enhanced to work with
|
856
|
+
multi-dimensional arrays and jagged arrays.
|
857
|
+
|
858
|
+
<li>The error message for AreEqual with doubles and floats now includes
|
859
|
+
the tolerance that was used in the comparison.
|
860
|
+
|
861
|
+
<li>The handling of categories was not being done correctly. This is now fixed.
|
862
|
+
|
863
|
+
</ul>
|
864
|
+
|
865
|
+
<h4>Console</h4>
|
866
|
+
<ul>
|
867
|
+
<li>The '/' character is no longer accepted for command-line options under Linux.
|
868
|
+
Any argument beginning with '/' is taken as a path.
|
869
|
+
|
870
|
+
<li>Fixed bug causing the /include and /exclude parameters to be ignored.
|
871
|
+
</ul>
|
872
|
+
|
873
|
+
<h4>Gui</h4>
|
874
|
+
<ul>
|
875
|
+
<li>Added a dialog to the Tools menu for displaying installed NUnit add-ins.
|
876
|
+
|
877
|
+
<li>Modified the Tree submenu of the View menu to simplify choices for
|
878
|
+
expanding and collapsing the tree.
|
879
|
+
|
880
|
+
<li>Added an entry to the View menu for displaying info about loaded test assemblies.
|
881
|
+
|
882
|
+
<li>Added Run All, Run Failed, Show CheckBoxes, Expand All and Collapse All
|
883
|
+
items to the tree context menu.
|
884
|
+
|
885
|
+
<li>When right-clicking in the tree below the lowest node, the context menu commands
|
886
|
+
now relate to the currently selected node or nodes rather than the last node the
|
887
|
+
user right-clicked on.
|
888
|
+
|
889
|
+
<li>The '/' character is no longer accepted for command-line options under Linux.
|
890
|
+
Any argument beginning with '/' is taken as a path.
|
891
|
+
|
892
|
+
<li>The category list is now cleared when a project is closed.
|
893
|
+
|
894
|
+
<li>The "Word Wrap" checkbox has been removed. The setting is now available on
|
895
|
+
the Options Dialog.
|
896
|
+
|
897
|
+
<li>Automatic rerun of tests on change now works correctly.
|
898
|
+
</ul>
|
899
|
+
|
900
|
+
<h4>Extensibility</h4>
|
901
|
+
<ul>
|
902
|
+
<li>The extensibility mechanism has been generalized to allow a wider range
|
903
|
+
of future extension points. The following new attributes and interfaces
|
904
|
+
are used:
|
905
|
+
<dl style="margin-left: 2em">
|
906
|
+
<dt>NUnitAddinAttribute
|
907
|
+
<dd>Used to mark all addins and optionally specify Type, Name and Description
|
908
|
+
<dt>ExtensionType
|
909
|
+
<dd>Indicates whether the addin provides Core, Client or Gui extensions.
|
910
|
+
<dt>IAddin
|
911
|
+
<dd>Interface implemented by all addins, which allows the addin to install itself.
|
912
|
+
<dt>IExtensionHost
|
913
|
+
<dd>Interface supported by each NUnit extension host. Each host provides a number of extension points.
|
914
|
+
This release provides only the Core extension host. Future releases will provide Client and Gui hosts.
|
915
|
+
<dt>IExtensionPoint
|
916
|
+
<dd>Interface supported by an extension point, allowing an addin to install and remove the extensions it provides.
|
917
|
+
<dt>IFrameworkRegistry
|
918
|
+
<dd>Interface allowing addins that support external test frameworks to register them with NUnit.
|
919
|
+
</dl>
|
920
|
+
</ul>
|
921
|
+
|
922
|
+
<h3>NUnit 2.4 Beta 1 Release (2.3.6162) - June 11, 2006</h3>
|
923
|
+
|
924
|
+
<h4>General</h4>
|
925
|
+
<ul>
|
926
|
+
<li>Additional NUnit tests now pass under Linux. Those that do not have
|
927
|
+
been excluded using the Platform attribute.
|
928
|
+
|
929
|
+
</ul>
|
930
|
+
<h4>Framework</h4>
|
931
|
+
<ul>
|
932
|
+
<li>Added a Reason property to ExplicitAttribute, for use in explaining why a test is marked Explicit.
|
933
|
+
|
934
|
+
<li>Multiple SetUp or TearDown methods now give a more meaningful error message.
|
935
|
+
</ul>
|
936
|
+
|
937
|
+
<h4>Console</h4>
|
938
|
+
<ul>
|
939
|
+
<li>The console now outputs test failures to Trace all the time, not just
|
940
|
+
when running under the debugger. You will see clickable trace output in
|
941
|
+
Visual Studio even if you use the Start Without Debugging menu item.
|
942
|
+
</ul>
|
943
|
+
|
944
|
+
<h4>Gui</h4>
|
945
|
+
<ul>
|
946
|
+
<li>Added Test Menu with entries for running the selected test, all tests or failed tests.
|
947
|
+
|
948
|
+
<li>Instead of displaying a dialog box, unhandled exceptions now display in the
|
949
|
+
Errors & Failures tab, with an indication of the test that was running
|
950
|
+
when the exception was thrown. The test itself is not shown as a failure,
|
951
|
+
(unless it failed for some other reason, since it may not have caused the
|
952
|
+
exception. The progress bar turns red if any unhandled exceptions are thrown.
|
953
|
+
|
954
|
+
<li>The GUI no longer crashes when reloading assemblies with added or deleted
|
955
|
+
tests.
|
956
|
+
</ul>
|
957
|
+
|
958
|
+
<h3>NUnit 2.4 Alpha Release (2.3.6142) - May 22, 2006</h3>
|
959
|
+
|
960
|
+
<h4>General</h4>
|
961
|
+
<ul>
|
962
|
+
<li>The source code directory structure has been reorganized to separate NUnitFramework and
|
963
|
+
NUnitCore.
|
964
|
+
|
965
|
+
<li>A new nunit.common assembly isolates core interfaces.
|
966
|
+
|
967
|
+
<li>The following assemblies are now strongly named: nunit.mocks, nunit.core.extensions
|
968
|
+
and nunit.framework.extensions
|
969
|
+
|
970
|
+
<li>NUnit may now be installed by non-administrators, subject to any security
|
971
|
+
restrictions imposed by the particular site.
|
972
|
+
|
973
|
+
<li>The .Net 2.0 builds of NUnit are now called "NUnit for .Net 2.0"
|
974
|
+
|
975
|
+
<li>The NAnt build script has been simplified and now consists only of the
|
976
|
+
<b>nunit.build</b> and <b>nunit.build.include</b> files.
|
977
|
+
|
978
|
+
<li>The NAnt build script now has a target for building under the Mono 2.0 profile.
|
979
|
+
|
980
|
+
<li>NUnit is now been built and tested using both Microsoft .Net (1.0, 1.1, 2.0) and Mono
|
981
|
+
(1.0 and 2.0 profiles).<br><br>
|
982
|
+
<b>Note:</b> in the Alpha release, a number of tests are skipped
|
983
|
+
when running under Linux or Unix.
|
984
|
+
|
985
|
+
</ul>
|
986
|
+
|
987
|
+
<h4>Framework</h4>
|
988
|
+
<ul>
|
989
|
+
<li>A new CollectionAssert class has been added. It supports the following methods:
|
990
|
+
<dl style="margin-left: 2em">
|
991
|
+
<dt>AllItemsAreInstancesOf
|
992
|
+
<dd>Tests that all members of a collection are instances of a class
|
993
|
+
<dt>AllItemsAreNotNull
|
994
|
+
<dd>Tests that all collection members are non-null.
|
995
|
+
<dt>AllItemsAreUnique
|
996
|
+
<dd>Tests that all collection members are unique
|
997
|
+
<dt>AreEqual / AreNotEqual
|
998
|
+
<dd>Test whether two collections are equal, having the same members in the same order
|
999
|
+
<dt>AreEquivalent / AreNotEquivalent
|
1000
|
+
<dd>Test whether two collections are equivalent, having the same members without regard to order
|
1001
|
+
<dt>Contains / DoesNotContain
|
1002
|
+
<dd>Test whether a collection contains a particular object
|
1003
|
+
<dt>IsSubsetOf / IsNotSubsetOf
|
1004
|
+
<dd>Test whether one collection is a subset of another
|
1005
|
+
<dt>IsEmpty / IsNotEmpty
|
1006
|
+
<dd>Test whether a collection is empty or not
|
1007
|
+
</dl><p><p>
|
1008
|
+
|
1009
|
+
<b>Note:</b> In the Alpha release, IsEmpty, IsNotEmpty and Contains also continue
|
1010
|
+
to be available in the Assert class. We will be seeking feedback to determine
|
1011
|
+
whether these methods should be removed.
|
1012
|
+
|
1013
|
+
<li>A new FileAssert class has been added. It supports the following methods:
|
1014
|
+
<dl style="margin-left: 2em">
|
1015
|
+
<dt>AreEqual( Stream, Stream )
|
1016
|
+
<dt>AreEqual( FileInfo, FileInfo )
|
1017
|
+
<dt>AreEqual( string, string )
|
1018
|
+
<dt>AreNotEqual( Stream, Stream )
|
1019
|
+
<dt>AreNotEqual( FileInfo, FileInfo )
|
1020
|
+
<dt>AreNotEqual( string, string )
|
1021
|
+
</dl>
|
1022
|
+
|
1023
|
+
<li>The following new methods have been added to the Assert Class:
|
1024
|
+
<dl style="margin-left: 2em">
|
1025
|
+
<dt>Assert.GreaterOrEqual()
|
1026
|
+
<dt>Assert.LessOrEqual()
|
1027
|
+
</dl>
|
1028
|
+
|
1029
|
+
<li>The following new overloads have been added to the Assert class:
|
1030
|
+
<dl style="margin-left: 2em">
|
1031
|
+
<dt>Assert.AreEqual( long, long )
|
1032
|
+
<dt>Assert.AreEqual( ulong, ulong )
|
1033
|
+
<dt>Assert.AreNotEqual( long, long )
|
1034
|
+
<dt>Assert.AreNotEqual( ulong, ulong )
|
1035
|
+
</dl>
|
1036
|
+
|
1037
|
+
<li>The following Asserts have been re-implemented in terms of AreEqual and
|
1038
|
+
AreNotEqual in order to provide clearer messages when they fail:
|
1039
|
+
<dl style="margin-left: 2em">
|
1040
|
+
<dt>IsTrue / IsFalse
|
1041
|
+
<dt>IsNull / IsNotNull
|
1042
|
+
<dt>IsNaN
|
1043
|
+
<dt>IsEmpty / IsNotEmpty (string only)
|
1044
|
+
</dl>
|
1045
|
+
|
1046
|
+
<li>A new PropertyAttribute allows setting arbitrary named properties on test
|
1047
|
+
cases and fixtures. NUnit makes no use of these properties
|
1048
|
+
but they may be accessed from the tests via reflection.
|
1049
|
+
|
1050
|
+
<li>ExpectedExceptionAttribute now takes an optional third argument to specify
|
1051
|
+
how the expected message should be matched. In addition to an exact match,
|
1052
|
+
as now, you may specify a string which should be contained in the message
|
1053
|
+
or a regular expression to be matched against the actual message.
|
1054
|
+
</ul>
|
1055
|
+
|
1056
|
+
<h4>Core</h4>
|
1057
|
+
<ul>
|
1058
|
+
<li>When multiple assemblies are loaded, they may use a single AppDomain, as now,
|
1059
|
+
or a separate AppDomain for each assembly. The new option provides greater
|
1060
|
+
isolation of the tests and allows use of separate config files for each assembly.
|
1061
|
+
<br><br>
|
1062
|
+
<b>Note:</b> In the Alpha release, separate config files are required when
|
1063
|
+
this option is used, even if an NUnit project is loaded.
|
1064
|
+
|
1065
|
+
<li>The automatic creation of test suites for each namespace is now optional. When
|
1066
|
+
the creation of these suites is suppressed, the fixtures are loaded as a simple
|
1067
|
+
flat list, without any hierarchy imposed.
|
1068
|
+
|
1069
|
+
<li>When multiple assemblies are loaded, the tests may optionally be merged. If
|
1070
|
+
automatic namespace suites are enabled, namespaces are merged across assemblies.
|
1071
|
+
This option is only available if a single AppDomain is used.
|
1072
|
+
|
1073
|
+
<li>The fixture object is created for the life of the test run and is no longer
|
1074
|
+
reused on subsequent runs. If the object implements IDisposable, Dispose
|
1075
|
+
is called before destroying it.
|
1076
|
+
|
1077
|
+
<li>The current directory is set to the location of the test assembly before
|
1078
|
+
running each fixture. This change facilitates running fixtures in any order
|
1079
|
+
and eliminates interference between fixtures that change the current directory.
|
1080
|
+
|
1081
|
+
<li>Non-public fixture classes are treated as non-runnable and display a warning
|
1082
|
+
message rather than being silently ignored.
|
1083
|
+
|
1084
|
+
<li>A new SetUpFixture allows one-time SetUp and TearDown at the level of a
|
1085
|
+
NameSpace or for an entire assembly.<p><p>
|
1086
|
+
|
1087
|
+
<li>The TestRunner no longer passes "live" tests back to the gui or console.
|
1088
|
+
Instead, a data class that encapsulates the info about the test is sent.
|
1089
|
+
|
1090
|
+
<li>Registry settings are now stored under nunit.org. Old settings are migrated
|
1091
|
+
automatically when the application is first run.
|
1092
|
+
|
1093
|
+
<li>When the default config for a test project is set to "NUnitAutoConfig"
|
1094
|
+
the configuration of the current NUnit build is automatically selected
|
1095
|
+
for the tests, if available. This is intended for use by NUnit developers.
|
1096
|
+
|
1097
|
+
</ul>
|
1098
|
+
|
1099
|
+
<h4>Console</h4>
|
1100
|
+
<ul>
|
1101
|
+
<li>When multiple assemblies are passed on the command line, the console runner
|
1102
|
+
now loads those assemblies into separate AppDomains. Separate config files
|
1103
|
+
should be provided for each assembly in this case.
|
1104
|
+
|
1105
|
+
<li>The <b>/include</b> and <b>/exclude></b> options may now be combined on
|
1106
|
+
the command line. When both are used, all tests with the included categories
|
1107
|
+
are run except for those with the excluded categories.
|
1108
|
+
|
1109
|
+
</ul>
|
1110
|
+
|
1111
|
+
<h4>Gui</h4>
|
1112
|
+
<ul>
|
1113
|
+
<li>The gui executable is now called "nunit.exe" rather than "nunit-gui.exe"
|
1114
|
+
|
1115
|
+
<li>There is a new option to automatically re-run the test whenever
|
1116
|
+
a change is detected.
|
1117
|
+
|
1118
|
+
<li>A new "mini-gui" configuration may be selected from the View menu. This
|
1119
|
+
display consists of the tree view area only. All info about the tests may
|
1120
|
+
be accessed via the properties display or by returning to the full gui.
|
1121
|
+
|
1122
|
+
<li>The following additional Gui customizations are also available through the
|
1123
|
+
View menu:
|
1124
|
+
<ul>
|
1125
|
+
<li>The font used in the Gui may be changed
|
1126
|
+
<li>The four info tabs on the right may be turned on or off
|
1127
|
+
<li>The status bar may be removed
|
1128
|
+
</ul>
|
1129
|
+
|
1130
|
+
<li>Menu items pertaining to expansion and collapse of the tree have been moved
|
1131
|
+
to the Tree submenu of the View menu.
|
1132
|
+
|
1133
|
+
<li>The Options dialog has been reorganized to add new options for running tests
|
1134
|
+
and to better group similar items.
|
1135
|
+
|
1136
|
+
<li>The Test Properties dialog has been reorganized to display all info on a
|
1137
|
+
single page and to more clearly show the status of the test.
|
1138
|
+
|
1139
|
+
<li>The icons used for tests in the tree view now show test status by use of
|
1140
|
+
symbols, in addition to their color:
|
1141
|
+
<dl style="margin-left: 2em">
|
1142
|
+
<dt>Not Run
|
1143
|
+
<dd>Grey circle
|
1144
|
+
<dt>Success
|
1145
|
+
<dd>Green circle with a check mark in it
|
1146
|
+
<dt>Failure
|
1147
|
+
<dd>Red circle with an X mark in it
|
1148
|
+
<dt>Ignored
|
1149
|
+
<dd>Yellow circle with a question mark in it
|
1150
|
+
</dl>
|
1151
|
+
|
1152
|
+
<li>For further customization of the icons, users may modify or replace the
|
1153
|
+
files Success.jpg, Failure.jpg or Ignored.jpg in the NUnit bin directory.
|
1154
|
+
|
1155
|
+
<li>Tests that are not run due to the Explicit or Platform attributes are no
|
1156
|
+
longer considered as Ignored. They remain marked as grey in the gui and
|
1157
|
+
do not affect the color of the progress bar.
|
1158
|
+
|
1159
|
+
<li>Wordwrap may be turned on and off in the 'Errors and Failures' tab by use
|
1160
|
+
of a checkbox at the bottom of the tab.
|
1161
|
+
</ul>
|
1162
|
+
|
1163
|
+
<h4>Extensibility</h4>
|
1164
|
+
<ul>
|
1165
|
+
<li>NUnit now supports three types of core addins:
|
1166
|
+
<dl style="margin-left: 2em">
|
1167
|
+
<dt>SuiteBuilders
|
1168
|
+
<dd>Allow an extender to provide new types of test fixtures with
|
1169
|
+
their own behavior.
|
1170
|
+
<dt>TestCaseBuilders
|
1171
|
+
<dd>Allow an extender to provide new types of test cases, either
|
1172
|
+
as a part of a custom test fixture or within a standard NUnit
|
1173
|
+
fixture.
|
1174
|
+
<dt>TestDecorators
|
1175
|
+
<dd>Allow an extender to modify the behavior of
|
1176
|
+
a standard or custom test case or fixture. This is a good
|
1177
|
+
choice for implementing attributes that should apply to
|
1178
|
+
various types of tests.
|
1179
|
+
<dd>
|
1180
|
+
</dl>
|
1181
|
+
|
1182
|
+
<li>Addin assemblies may now be deployed by copying them assembly to the
|
1183
|
+
NUnit <b>bin/addins</b> directory.
|
1184
|
+
|
1185
|
+
<li>Extensions distributed as part of NUnit are now divided between the two
|
1186
|
+
assemblies nunit.core.extensions and nunit.framework.extensions. Only the
|
1187
|
+
latter is intended to be referenced by user tests.
|
1188
|
+
|
1189
|
+
<li>This Alpha release of NUnit provides only one internal extension: the Repeat
|
1190
|
+
attribute may be applied to test cases to cause them to run a number of
|
1191
|
+
times. The extensions emulating CsUnit and VSTS tests, which were included
|
1192
|
+
experimentally in recent versions of NUnit 2.2 have been removed and will
|
1193
|
+
be distributed separately.
|
1194
|
+
|
1195
|
+
<li>Several trivial examples, which were formerly part of the extensions
|
1196
|
+
assmebly are now included as samples.
|
1197
|
+
|
1198
|
+
<li>Documentation for NUnit's extensibility features is still in preparation.
|
1199
|
+
</ul>
|
1200
|
+
|
1201
|
+
<h3>Earlier Releases</h3>
|
1202
|
+
|
1203
|
+
Cumulative notes through NUnit 2.2.10 are available <a href="docs/2.2.10/releaseNotes.html">here</a></h3>
|
1204
|
+
|
1205
|
+
|
1206
|
+
</div>
|
1207
|
+
|
1208
|
+
<!-- Submenu -->
|
1209
|
+
<div id="subnav">
|
1210
|
+
<ul>
|
1211
|
+
<li><a href="index.html">NUnit 2.4.8</a></li>
|
1212
|
+
<ul>
|
1213
|
+
<li><a href="getStarted.html">Getting Started</a></li>
|
1214
|
+
<li><a href="assertions.html">Assertions</a></li>
|
1215
|
+
<li><a href="attributes.html">Attributes</a></li>
|
1216
|
+
<li><a href="nunit-console.html">Console Runner</a></li>
|
1217
|
+
<li><a href="nunit-gui.html">Gui Runner</a></li>
|
1218
|
+
<li><a href="features.html">Other Features</a></li>
|
1219
|
+
<li id="current"><a href="releaseNotes.html">Release Notes</a></li>
|
1220
|
+
<li><a href="samples.html">Samples</a></li>
|
1221
|
+
<li><a href="license.html">License</a></li>
|
1222
|
+
</ul>
|
1223
|
+
</ul>
|
1224
|
+
</div>
|
1225
|
+
<!-- End of Submenu -->
|
1226
|
+
|
1227
|
+
|
1228
|
+
<!-- Standard Footer for NUnit.org -->
|
1229
|
+
<div id="footer">
|
1230
|
+
Copyright © 2008 Charlie Poole. All Rights Reserved.
|
1231
|
+
</div>
|
1232
|
+
<!-- End of Footer -->
|
1233
|
+
|
1234
|
+
</body>
|
1235
|
+
</html>
|