~ifolder-dev/simias/trunk-packaging

« back to all changes in this revision

Viewing changes to tools/NUnit/net/doc/.svn/text-base/exception.html.svn-base

  • Committer: Jorge O. Castro
  • Date: 2007-12-03 06:56:46 UTC
  • Revision ID: jorge@ubuntu.com-20071203065646-mupcnjcwgm5mnhyt
* Remove a bunch of .svn directories we no longer need.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<html>
2
 
 
3
 
<head>
4
 
<title>NUnit</title>
5
 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
 
<script language="JavaScript" type="text/JavaScript"> <!--
7
 
        var navLine = null;
8
 
        if (navigator.appName == "Netscape") {
9
 
                if (parseInt(navigator.appVersion) >= 5) {
10
 
                        document.writeln("<link rel=\"stylesheet\" type=\"text/css\" href=\"css/styleGuide.css\">");
11
 
                        navLine = "<td height=\"1\" bgcolor=\"666030\" width=\"*\"><img src=\"img/blankPixel.gif\"></td>";
12
 
                } else {
13
 
                        navLine = "<td height=\"1\" bgcolor=\"666030\" width=\"52%\"><img src=\"img/blankPixel.gif\"></td>";
14
 
                        document.writeln("<link rel=\"stylesheet\" type=\"text/css\" href=\"css/styleGuideNN.css\">");
15
 
                        document.writeln("<style type=\"text/css\">");
16
 
                        document.writeln("<!-- .bodytext { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: .65em; color: #000000 }");
17
 
                        document.writeln("-->");
18
 
                        document.writeln("</style>");
19
 
                }
20
 
        }
21
 
         else if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
22
 
                navLine = "<td height=\"1\" bgcolor=\"666030\" width=\"*\"><img src=\"img/blankPixel.gif\"></td>";
23
 
                document.writeln("<link rel=\"stylesheet\" type=\"text/css\" href=\"css/styleGuideIE.css\">");
24
 
        }
25
 
        else {
26
 
                navLine = "<td height=\"1\" bgcolor=\"666030\" width=\"*\"><img src=\"img/blankPixel.gif\"></td>";
27
 
                document.writeln("<link rel=\"stylesheet\" type=\"text/css\" href=\"css/styleGuide.css\">");
28
 
        }
29
 
// -->
30
 
</script>
31
 
</head>
32
 
 
33
 
<body text="#000000" marginwidth="0" rightmargin="0">
34
 
 
35
 
<table width="100%" border="0" cellspacing="0" cellpadding="0">
36
 
        <tr>
37
 
                <td width="25%"><a href="index.html" target="_self">
38
 
                <img src="img/logo.gif" hspace="15" vspace="0" border="0" alt="NUnit"></a></td>
39
 
                <td valign="top"><span class="navTable">
40
 
                <table width="110%" border="0" cellspacing="0" cellpadding="1" height="40" vspace="15" class="divider">
41
 
                        <tr>
42
 
                                <td>
43
 
                                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="link">
44
 
                                        <tr>
45
 
                                                <td bgcolor="#FFFFFF">
46
 
                                                <table border="0" cellspacing="10" cellpadding="0">
47
 
                                                        <tr>
48
 
                                                                <td>
49
 
                                                                <table width="100%" border="0" cellspacing="0" cellpadding="1" class="divider">
50
 
                                                                        <tr>
51
 
                                                                                <td>
52
 
                                                                                <table width="100%" border="0" cellspacing="0" cellpadding="5" class="link">
53
 
                                                                                        <tr>
54
 
                                                                                                <td class="navtext" bgcolor="#FFFFFF">
55
 
                                                                                                <div align="center">
56
 
                                                                                                        <a href="index.html" target="_self">
57
 
                                                                                                        <img src="img/homeOff.gif" width="40" height="12" alt="Home" border="0"></a></div>
58
 
                                                                                                </td>
59
 
                                                                                        </tr>
60
 
                                                                                </table>
61
 
                                                                                </td>
62
 
                                                                        </tr>
63
 
                                                                </table>
64
 
                                                                </td>
65
 
                                                                <td>
66
 
                                                                <table width="100%" border="0" cellspacing="0" cellpadding="1" class="divider">
67
 
                                                                        <tr>
68
 
                                                                                <td>
69
 
                                                                                <table width="100%" border="0" cellspacing="0" cellpadding="5" class="link">
70
 
                                                                                        <tr>
71
 
                                                                                                <td class="navtext" bgcolor="#FFFFFF">
72
 
                                                                                                <div align="center">
73
 
                                                                                                        <a href="download.html" target="_self">
74
 
                                                                                                        <img src="img/downloadOff.gif" width="78" height="12" alt="Download" border="0"></a></div>
75
 
                                                                                                </td>
76
 
                                                                                        </tr>
77
 
                                                                                </table>
78
 
                                                                                </td>
79
 
                                                                        </tr>
80
 
                                                                </table>
81
 
                                                                </td>
82
 
                                                                <td>
83
 
                                                                <table width="100%" border="0" cellspacing="0" cellpadding="1" class="divider">
84
 
                                                                        <tr>
85
 
                                                                                <td>
86
 
                                                                                <table width="100%" border="0" cellspacing="0" cellpadding="5" class="selected">
87
 
                                                                                        <tr>
88
 
                                                                                                <td class="navtext">
89
 
                                                                                                <div align="center">
90
 
                                                                                                        <a target="_self" href="documentation.html">
91
 
                                                                                                        <img src="img/documentationOn.gif" width="118" height="12" alt="Documentation" border="0"></a></div>
92
 
                                                                                                </td>
93
 
                                                                                        </tr>
94
 
                                                                                </table>
95
 
                                                                                </td>
96
 
                                                                        </tr>
97
 
                                                                </table>
98
 
                                                                </td>
99
 
                                                                <td>
100
 
                                                                <table width="100%" border="0" cellspacing="0" cellpadding="1" class="divider">
101
 
                                                                        <tr>
102
 
                                                                                <td>
103
 
                                                                                <table width="100%" border="0" cellspacing="0" cellpadding="5" class="link">
104
 
                                                                                        <tr>
105
 
                                                                                                <td class="navtext" bgcolor="#FFFFFF">
106
 
                                                                                                <div align="center">
107
 
                                                                                                        <a href="community.html" target="_self">
108
 
                                                                                                        <img src="img/communityOff.gif" width="83" height="12" alt="Community" border="0"></a></div>
109
 
                                                                                                </td>
110
 
                                                                                        </tr>
111
 
                                                                                </table>
112
 
                                                                                </td>
113
 
                                                                        </tr>
114
 
                                                                </table>
115
 
                                                                </td>
116
 
                                                                <td>
117
 
                                                                <table width="100%" border="0" cellspacing="0" cellpadding="1" class="divider">
118
 
                                                                        <tr>
119
 
                                                                                <td>
120
 
                                                                                <table width="100%" border="0" cellspacing="0" cellpadding="5" class="link">
121
 
                                                                                        <tr>
122
 
                                                                                                <td class="navtext" bgcolor="#FFFFFF">
123
 
                                                                                                <div align="center">
124
 
                                                                                                        <a href="resources.html" target="_self">
125
 
                                                                                                        <img src="img/resourcesOff.gif" width="81" height="12" alt="Resources" border="0"></a></div>
126
 
                                                                                                </td>
127
 
                                                                                        </tr>
128
 
                                                                                </table>
129
 
                                                                                </td>
130
 
                                                                        </tr>
131
 
                                                                </table>
132
 
                                                                </td>
133
 
                                                                <td>
134
 
                                                                <table width="100%" border="0" cellspacing="0" cellpadding="1" class="divider">
135
 
                                                                        <tr>
136
 
                                                                                <td>
137
 
                                                                                <table width="100%" border="0" cellspacing="0" cellpadding="5" class="link">
138
 
                                                                                        <tr>
139
 
                                                                                                <td class="navtext" bgcolor="#FFFFFF">
140
 
                                                                                                <div align="center">
141
 
                                                                                                        <a href="contactUs.html" target="_self">
142
 
                                                                                                        <img src="img/contactUsOff.gif" width="83" height="12" alt="Contact Us" border="0"></a></div>
143
 
                                                                                                </td>
144
 
                                                                                        </tr>
145
 
                                                                                </table>
146
 
                                                                                </td>
147
 
                                                                        </tr>
148
 
                                                                </table>
149
 
                                                                </td>
150
 
                                                        </tr>
151
 
                                                </table>
152
 
                                                </td>
153
 
                                        </tr>
154
 
                                </table>
155
 
                                </td>
156
 
                        </tr>
157
 
                </table>
158
 
                </span>
159
 
                <table border="0" cellspacing="0" cellpadding="0" width="100%">
160
 
                        <tr>
161
 
                                <td align="right" width="240">
162
 
                                <img src="img/navDiv.gif" width="1" height="23" alt="|"></td>
163
 
                                <td>&nbsp;</td>
164
 
                                <td width="120">&nbsp;</td>
165
 
                        </tr>
166
 
                        <tr>
167
 
                                <td height="1" align="right" valign="top" width="240">
168
 
                                <img src="img/cornerPixel.gif" width="1" height="1" alt="*"></td>
169
 
                                <script language="JavaScript" type="text/JavaScript"> <!--
170
 
                                document.writeln(navLine);
171
 
                        // -->
172
 
                        </script>
173
 
                                <td height="1" align="left" valign="bottom" width="120">
174
 
                                <img src="img/cornerPixel.gif" width="1" height="1" alt="*"></td>
175
 
                        </tr>
176
 
                        <tr>
177
 
                                <td width="240">&nbsp;</td>
178
 
                                <td>&nbsp;</td>
179
 
                                <td align="left" width="120">
180
 
                                <img src="img/navDiv.gif" width="1" height="23" alt="|"></td>
181
 
                        </tr>
182
 
                </table>
183
 
                </td>
184
 
        </tr>
185
 
</table>
186
 
<table width="100%" border="0" cellspacing="0" cellpadding="0">
187
 
        <tr>
188
 
                <td valign="top"><br>
189
 
                <table width="90%" border="0" cellspacing="0" cellpadding="0" class="lefttables">
190
 
                        <tr>
191
 
                                <td class="bodytext">
192
 
                                <p></p>
193
 
                                <p><b>Expected Exception (NUnit 2.0)</b><br>
194
 
                                This is the way to specify that the execution of a test will throw
195
 
                                an exception. This attribute takes a parameter which is a Type.
196
 
                                The runner will execute the test and if it throws the specific exception,
197
 
                                then the test passes. If it throws a different exception the test
198
 
                                will fail. This is true even if the thrown exception inherits from
199
 
                                the expected exception.<br>
200
 
                                <br>
201
 
                                ExpectedException Example:</p>
202
 
                                <p>
203
 
                                <script language="JavaScript">
204
 
    function doClick(index, numTabs, id) {
205
 
        document.all("tab" + id, index).className = "tab";
206
 
        for (var i=1; i < numTabs; i++) {
207
 
            document.all("tab" + id, (index + i) % numTabs).className = "backtab";
208
 
        }
209
 
        document.all("code" + id, index).style.display = "";
210
 
        for (var j=1; j < numTabs; j++) {
211
 
          document.all("code" + id, (index + j) % numTabs).style.display = "none";
212
 
        }
213
 
    }
214
 
                        </script>
215
 
                                <style>
216
 
    td.code {
217
 
      border-left:1px solid cccccc; border-bottom:1px solid cccccc; border-top:1px solid cccccc; border-right:1px solid cccccc; background-color:eeffff; padding-left:10; padding-right:10; padding-top:0; padding-bottom:0
218
 
    }
219
 
 
220
 
    td.tab {
221
 
      border-left:1px solid black; border-top:1px solid black; border-bottom:1px solid black; text-align:center;
222
 
      width:15%;
223
 
      padding:3;
224
 
      border-right:0px none black;
225
 
      background-color:eeeeee;
226
 
      cursor:hand; font-style:normal; font-variant:normal; font-weight:normal; font-size:8pt; font-family:verdana
227
 
    }
228
 
 
229
 
    td.backtab {
230
 
      border-left:1px solid black; border-top:1px solid black; border-bottom:1px solid black; text-align:center;
231
 
      width:15%;
232
 
      padding:3;
233
 
      border-right:0px none black;
234
 
      background-color:cccccc;
235
 
      cursor:hand; font-style:normal; font-variant:normal; font-weight:normal; font-size:8pt; font-family:verdana
236
 
    }
237
 
 
238
 
    td.topspace {
239
 
      border-left:1px none cccccc; border-top:0px none cccccc; width:55%;
240
 
      padding:0;
241
 
      border-bottom:1px none cccccc;
242
 
      border-right:1px none cccccc;
243
 
      background-color:white; font-style:normal; font-variant:normal; font-weight:normal; font-size:8pt; font-family:verdana
244
 
    }
245
 
 
246
 
    td.space {
247
 
      border-left:1px solid black; border-top:0px none cccccc; width:55%;
248
 
      padding:0;
249
 
      border-bottom:1px none cccccc;
250
 
      border-right:1px none cccccc;
251
 
      background-color:white; font-style:normal; font-variant:normal; font-weight:normal; font-size:8pt; font-family:verdana
252
 
    }
253
 
                        </style>
254
 
                                </p>
255
 
                                <table cellpadding="0" cellspacing="0" width="95%">
256
 
                                        <tr>
257
 
                                                <td class="code" colspan="4">
258
 
                                                <pre id="code_ctl2" style="display:">namespace NUnit.Tests
259
 
{
260
 
  using System;
261
 
  using NUnit.Framework;
262
 
 
263
 
  [TestFixture]
264
 
  public class SuccessTests
265
 
  {
266
 
    [Test]
267
 
    [ExpectedException(typeof(InvalidOperationException))]
268
 
    public void ExpectAnException()
269
 
    { /* ... */ }
270
 
  }
271
 
}
272
 
</pre>
273
 
                                                <pre id="code_ctl2" style="display:none">Imports System
274
 
Imports Nunit.Framework
275
 
 
276
 
Namespace Nunit.Tests
277
 
 
278
 
  &lt;TestFixture()&gt; Public Class SuccessTests
279
 
    &lt;Test(), ExpectedException(GetType(Exception))&gt;
280
 
      Public Sub ExpectAnException()
281
 
    &#39; ...
282
 
    End Sub
283
 
  End Class
284
 
End Namespace
285
 
</pre>
286
 
                                                <pre id="code_ctl2" style="display:none">#using &lt;Nunit.Framework.dll&gt;
287
 
using namespace System;
288
 
using namespace NUnit::Framework;
289
 
 
290
 
namespace NUnitTests
291
 
{
292
 
  [TestFixture]
293
 
  public __gc class SuccessTests
294
 
  {
295
 
    [Test] [ExpectedException(__typeof(InvalidOperationException))]
296
 
      void ExpectAnException();
297
 
  };
298
 
}
299
 
 
300
 
#include &quot;cppsample.h&quot;
301
 
 
302
 
namespace NUnitTests {
303
 
  // ...
304
 
}
305
 
</pre>
306
 
                                                </td>
307
 
                                                <td class="topspace"></td>
308
 
                                        </tr>
309
 
                                        <tr>
310
 
                                                <td colspan="5"><br>
311
 
                                                </td>
312
 
                                        </tr>
313
 
                                        <tr>
314
 
                                                <td class="tab" id="tab_ctl2" onclick="doClick(0, 3, '_ctl2')">
315
 
                                                <b>C#</b> </td>
316
 
                                                <td class="backtab" id="tab_ctl2" onclick="doClick(1, 3, '_ctl2')">
317
 
                                                <b>VB</b> </td>
318
 
                                                <td class="backtab" id="tab_ctl2" onclick="doClick(2, 3, '_ctl2')">
319
 
                                                <b>Managed C++</b> </td>
320
 
                                                <td class="space">&nbsp;</td>
321
 
                                        </tr>
322
 
                                </table>
323
 
                                </td>
324
 
                        </tr>
325
 
                </table>
326
 
                <table width="90%" border="0" cellspacing="0" cellpadding="0" class="lefttables">
327
 
                        <tr>
328
 
                                <td class="copyrighttext"><br><hr>
329
 
                                Copyright � 2002-2004 James W. Newkirk, Alexei A. Vorontsov. All
330
 
                                Rights Reserved. </td>
331
 
                        </tr>
332
 
                </table>
333
 
                </td>
334
 
                <td width="1" valign="top">
335
 
                <img src="img/sideDivider.gif" width="1" height="435" alt="|"></td>
336
 
                <td width="235" valign="top">
337
 
                <table border="0" cellspacing="0" cellpadding="0" align="center" class="subnavtable">
338
 
        <tr>
339
 
          <td align="center" width="15" class="blanktd"><a href="download.html" target="_self"><img src="img/bulletOff.gif" width="8" height="8" alt="*" border="0"></a></td>
340
 
          <td height="25" class="blanktd"><a href="getStarted.html" target="_self"><img src="img/getStarted.gif" width="125" height="12" alt="Getting Started" border="0"></a></td>
341
 
        </tr>
342
 
        <tr>
343
 
          <td align="center" width="15" class="blanktd"><a href="installation.html" target="_self"><img src="img/bulletOff.gif" width="8" height="8" alt="*" border="0"></a></td>
344
 
          <td height="25" class="blanktd"><a href="installation.html" target="_self"><img src="img/installation.gif" width="99" height="12" alt="Installation" border="0"></a></td>
345
 
        </tr>
346
 
        <tr>
347
 
          <td align="center" width="15" class="blanktd"><img src="img/bulletOff.gif" width="8" height="8" alt="&amp;#149;" border="0"></td>
348
 
          <td height="25" class="blanktd"><a href="assertions.html" target="_self"><img src="img/assertions.gif" width="83" height="12" alt="Assertions" border="0"></a></td>
349
 
        </tr>
350
 
        <tr>
351
 
          <td align="center" width="15" class="blanktd"><img src="img/bulletOff.gif" width="8" height="8" alt="&amp;#149;" border="0"></td>
352
 
          <td height="25" class="blanktd"><a href="attributes.html" target="_self"><img src="img/attribute.gif" width="83" height="12" alt="Attributes" border="0"></a></td>
353
 
        </tr>
354
 
                        <tr>
355
 
                                <td align="center" width="15" class="blanktd">&nbsp;</td>
356
 
                                <td height="25" class="blanktd"><a href="testFixture.html">
357
 
                                <img src="img/testFixtureOff.gif" width="112" height="12" alt="Test Fixture" border="0"></a></td>
358
 
                        </tr>
359
 
                        <tr>
360
 
                                <td align="center" width="15" class="blanktd">&nbsp;</td>
361
 
                                <td height="25" class="blanktd">
362
 
                                <a href="test.html" target="_self">
363
 
                                <img src="img/testOff.gif" width="52" height="12" alt="Test" border="0"></a></td>
364
 
                        </tr>
365
 
                        <tr>
366
 
                                <td align="center" width="15" class="blanktd">&nbsp;</td>
367
 
                                <td height="25" class="blanktd">
368
 
                                <a href="setupTeardown.html" target="_self">
369
 
                                <img src="img/setupTeardownOff.gif" width="140" height="12" alt="Setup/Teardown" border="0"></a></td>
370
 
                        </tr>
371
 
                        <tr>
372
 
                                <td align="center" width="15" class="blanktd">&nbsp;</td>
373
 
                                <td height="25" class="blanktd">
374
 
                                <a href="exception.html" target="_self">
375
 
                                <img src="img/expectedExceptionOn.gif" width="168" height="12" alt="Expected Exception" border="0"></a></td>
376
 
                        </tr>
377
 
        <tr>
378
 
          <td align="center" width="15" class="blanktd">&nbsp;</td>
379
 
          <td height="25" class="blanktd"><a href="category.html" target="_self"><img src="img/categoryOff.gif" width="92" height="12" alt="Category" border="0"></a></td>
380
 
        </tr>
381
 
        <tr>
382
 
          <td align="center" width="15" class="blanktd">&nbsp;</td>
383
 
          <td height="25" class="blanktd"><a href="explicit.html" target="_self"><img src="img/explicitOff.gif" width="80" height="12" alt="Explicit" border="0"></a></td>
384
 
        </tr>
385
 
                        <tr>
386
 
                                <td align="center" width="15" class="blanktd">&nbsp;</td>
387
 
                                <td height="25" class="blanktd">
388
 
                                <a href="suite.html" target="_self">
389
 
                                <img src="img/suiteOff.gif" width="58" height="12" border="0" alt="Suite"></a></td>
390
 
                        </tr>
391
 
                        <tr>
392
 
                                <td align="center" width="15" class="blanktd">&nbsp;</td>
393
 
                                <td height="25" class="blanktd">
394
 
                                <a href="ignore.html" target="_self">
395
 
                                <img src="img/ignoreOff.gif" width="72" height="12" alt="Ignore" border="0"></a></td>
396
 
                        </tr>
397
 
                        <tr>
398
 
                                <td align="center" width="15" class="blanktd">
399
 
                                <a href="upgrade.html" target="_self">
400
 
                                <img src="img/bulletOff.gif" width="8" height="8" alt="&amp;#149;" border="0"></a></td>
401
 
                                <td height="25" class="blanktd">
402
 
                                <a href="upgrade.html" target="_self">
403
 
                                <img src="img/upgrade.gif" width="83" height="12" alt="Upgrading" border="0"></a></td>
404
 
                        </tr>
405
 
                        <tr>
406
 
                                <td align="center" width="15" class="blanktd">
407
 
                                <a href="commandLine.html" target="_self">
408
 
                                <img src="img/bulletOff.gif" width="8" height="8" alt="&amp;#149;" border="0"></a></td>
409
 
                                <td height="25" class="blanktd">
410
 
                                <a href="commandLine.html" target="_self">
411
 
                                <img src="img/commandLine.gif" width="195" height="12" alt="Command-Line Parameters" border="0"></a></td>
412
 
                        </tr>
413
 
        <tr>
414
 
          <td align="center" width="15" class="blanktd"><a href="samples.html" target="_self"><img src="img/bulletOff.gif" width="8" height="8" alt="*" border="0"></a></td>
415
 
          <td height="25" class="blanktd"><a href="samples.html" target="_self"><img src="img/samples.gif" width="60" height="12" alt="Samples" border="0"></a></td>
416
 
        </tr>
417
 
                        <tr>
418
 
                                <td align="center" width="15" class="blanktd">
419
 
                                <a href="license.html" target="_self">
420
 
                                <img src="img/bulletOff.gif" width="8" height="8" alt="&amp;#149;" border="0"></a></td>
421
 
                                <td height="25" class="blanktd">
422
 
                                <a href="license.html" target="_self">
423
 
                                <img src="img/license.gif" width="62" height="12" alt="License" border="0"></a></td>
424
 
                        </tr>
425
 
                </table>
426
 
                </td>
427
 
        </tr>
428
 
</table>
429
 
 
430
 
</body>
431
 
 
432
 
</html>