1 | <!-- saved from url=(0014)about:internet --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
---|
2 | <html>
|
---|
3 | <!-- Standard Head Part -->
|
---|
4 | <head>
|
---|
5 | <title>NUnit - DelayedConstraint</title>
|
---|
6 | <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
---|
7 | <meta http-equiv="Content-Language" content="en-US">
|
---|
8 | <link rel="stylesheet" type="text/css" href="nunit.css">
|
---|
9 | <link rel="shortcut icon" href="favicon.ico">
|
---|
10 | </head>
|
---|
11 | <!-- End Standard Head Part -->
|
---|
12 |
|
---|
13 | <body>
|
---|
14 |
|
---|
15 | <!-- Standard Header for NUnit.org -->
|
---|
16 | <div id="header">
|
---|
17 | <a id="logo" href="http://www.nunit.org"><img src="img/logo.gif" alt="NUnit.org" title="NUnit.org"></a>
|
---|
18 | <div id="nav">
|
---|
19 | <a href="http://www.nunit.org">NUnit</a>
|
---|
20 | <a class="active" href="index.html">Documentation</a>
|
---|
21 | </div>
|
---|
22 | </div>
|
---|
23 | <!-- End of Header -->
|
---|
24 |
|
---|
25 | <div id="content">
|
---|
26 |
|
---|
27 | <h2>Delayed Constraint (NUnit 2.5)</h2>
|
---|
28 |
|
---|
29 | <p><b>DelayedConstraint</b> delays the application of another constraint until a certain
|
---|
30 | amount of time has passed. In it's simplest form, it replaces use of a Sleep
|
---|
31 | in the code but it also supports polling, which may allow use of a longer
|
---|
32 | maximum time while still keeping the tests as fast as possible.
|
---|
33 |
|
---|
34 | <p>The <b>After</b> modifier is permitted on any constraint, and the delay applies to
|
---|
35 | the entire expression up to the point where <b>After</b> appears.
|
---|
36 |
|
---|
37 | <p>Use of a <b>DelayedConstraint</b> with a value argument makes no sense, since
|
---|
38 | the value will be extracted at the point of call. It's intended use is with
|
---|
39 | delegates and references. If a delegate is used with polling, it may be called
|
---|
40 | multiple times so only methods without side effects should be used in this way.
|
---|
41 |
|
---|
42 | <table class="constraints">
|
---|
43 | <tr><th>Syntax Helper</th><th>Constructor</th><th>Operation</th></tr>
|
---|
44 | <tr><td>After(int)</td><td>DelayedConstraint(Constraint, int)</td></td><td>tests that a constraint is satisfied after a delay.</tr>
|
---|
45 | <tr><td>After(int, int)</td><td>DelayedConstraint(Constraint, int, int)</td></td><td>tests that a constraint is satisfied after a delay using polling.</tr>
|
---|
46 | </table>
|
---|
47 |
|
---|
48 |
|
---|
49 | </div>
|
---|
50 |
|
---|
51 | <!-- Submenu -->
|
---|
52 | <div id="subnav">
|
---|
53 | <ul>
|
---|
54 | <li><a href="index.html">NUnit 2.5.10</a></li>
|
---|
55 | <ul>
|
---|
56 | <li><a href="getStarted.html">Getting Started</a></li>
|
---|
57 | <li><a href="assertions.html">Assertions</a></li>
|
---|
58 | <li><a href="constraintModel.html">Constraints</a></li>
|
---|
59 | <ul>
|
---|
60 | <li><a href="equalConstraint.html">Equal Constraint</a></li>
|
---|
61 | <li><a href="sameasConstraint.html">SameAs Constraint</a></li>
|
---|
62 | <li><a href="conditionConstraints.html">Condition Constraints</a></li>
|
---|
63 | <li><a href="comparisonConstraints.html">Comparison Constrants</a></li>
|
---|
64 | <li><a href="pathConstraints.html">Path Constraints</a></li>
|
---|
65 | <li><a href="typeConstraints.html">Type Constraints</a></li>
|
---|
66 | <li><a href="stringConstraints.html">String Constraints</a></li>
|
---|
67 | <li><a href="collectionConstraints.html">Collection Constraints</a></li>
|
---|
68 | <li><a href="propertyConstraint.html">Property Constraint</a></li>
|
---|
69 | <li><a href="throwsConstraint.html">Throws Constraint</a></li>
|
---|
70 | <li><a href="compoundConstraints.html">Compound Constraints</a></li>
|
---|
71 | <li id="current"><a href="delayedConstraint.html">Delayed Constraint</a></li>
|
---|
72 | <li><a href="listMapper.html">List Mapper</a></li>
|
---|
73 | <li><a href="reusableConstraint.html">Reusable Constraint</a></li>
|
---|
74 | </ul>
|
---|
75 | <li><a href="attributes.html">Attributes</a></li>
|
---|
76 | <li><a href="runningTests.html">Running Tests</a></li>
|
---|
77 | <li><a href="extensibility.html">Extensibility</a></li>
|
---|
78 | <li><a href="releaseNotes.html">Release Notes</a></li>
|
---|
79 | <li><a href="samples.html">Samples</a></li>
|
---|
80 | <li><a href="license.html">License</a></li>
|
---|
81 | </ul>
|
---|
82 | </ul>
|
---|
83 | </div>
|
---|
84 | <!-- End of Submenu -->
|
---|
85 |
|
---|
86 |
|
---|
87 | <!-- Standard Footer for NUnit.org -->
|
---|
88 | <div id="footer">
|
---|
89 | Copyright © 2010 Charlie Poole. All Rights Reserved.
|
---|
90 | </div>
|
---|
91 | <!-- End of Footer -->
|
---|
92 |
|
---|
93 | </body>
|
---|
94 | </html>
|
---|