Author: frisco
Date: 2007-03-16 23:06:41 -0700 (Fri, 16 Mar 2007)
New Revision: 4368

Modified:
   sandbox/frisco/trunk/docs/src/dguide/testdriven.html
Log:
Change 20070316-laszlosystems-O by [EMAIL PROTECTED] on 2007-03-16 23:02:30 PDT
    in /Users/laszlosystems/src/svn/openlaszlo/sandbox

Summary: 

New Features:

Bugs Fixed:

Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
    

Tests:

Modified: sandbox/frisco/trunk/docs/src/dguide/testdriven.html
===================================================================
--- sandbox/frisco/trunk/docs/src/dguide/testdriven.html        2007-03-17 
05:54:25 UTC (rev 4367)
+++ sandbox/frisco/trunk/docs/src/dguide/testdriven.html        2007-03-17 
06:06:41 UTC (rev 4368)
@@ -82,7 +82,6 @@
 
 <p>The lightweight XUnit contains three classes and 12 methods. "Never in the 
field of software development was so much owed by so many to so few lines of 
code," said object-oriented design authority Martin Fowler. </p>
 
-<h2>Examples</h2>
 <h2>Counting Infinitely</h2>
 <p>In test-driven development, we devise a successful test case first, and 
then we fail it (because we wrote the test first). We want the first button 
click to change "stop" to "go", and the second click to "stop". The easiest 
solution, I think, is to give the button a "go" attribute which is a boolean, 
where its initial state is "false".</p>
 
@@ -201,7 +200,7 @@
 
 <p>A while statement attached to (goButton.go==true) would loop infinitely, or 
until a buttonclick set the "go" attribute to false, but how to test for 
infinity? Maybe it's something the developer has to take on faith, but 
JavaScript does have its limit: <code>Number.MAX_VALUE</code> is the largest 
number JavaScript can represent. The while statement is <code>while 
(goButton.counter &lt; Number.MAX_VALUE)</code>.</p>
 
-<p>I am not sure if it is good style to declare "counter" as a button 
attribute, but I think that must be better than initializing the counter 
variable on the canvas (with the script <code>&lt;script&gt;var 
goButton.counter=1;&lt;/script&gt;</code>). Before adding the code for the 
while loop and the code for the button attribute, there's a test to write: Does 
the goButton have a attribute "displayed" that equals 1?</p>
+<p>I am not sure if it is good style to declare "counter" as a button 
attribute, but I think that must be better than initializing the counter 
variable on the canvas (with the script <code>&lt;method event="oninit"&gt;var 
goButton.counter=1;&lt;/method&gt;</code>). Before adding the code for the 
while loop and the code for the button attribute, there's a test to write: Does 
the goButton have a attribute "displayed" that equals 1?</p>
 
 <example class="code" title="testGoButtonCounter">
 &lt;canvas debug="true"&gt;
@@ -532,11 +531,11 @@
 &lt;include href="lzunit"/&gt;
 &lt;simplelayout axis="y" spacing="10"/&gt;
 
-&lt;script&gt;
+&lt;method event="oninit"&gt;
 
 var a = new Array(10);
 
-&lt;/script&gt;
+&lt;/method&gt;
 
 &lt;TestSuite&gt;
     &lt;TestCase&gt;
@@ -559,11 +558,11 @@
 &lt;include href="lzunit"/&gt;
 &lt;simplelayout axis="y" spacing="10"/&gt;
 
-&lt;script&gt;
+&lt;method event="oninit"&gt;
 
 var a = new Array(10);
 
-&lt;/script&gt;
+&lt;/method&gt;
 
 &lt;TestSuite&gt;
     &lt;TestCase&gt;
@@ -586,7 +585,7 @@
 &lt;include href="lzunit"/&gt;
 &lt;simplelayout axis="y" spacing="10"/&gt;
 
-&lt;script&gt; <![CDATA[
+&lt;method event="oninit"&gt;
 
 var a = new Array(10);
 
@@ -594,7 +593,7 @@
     a[i] = Math.floor(Math.random()*101);
     }
 
-]]>&lt;/script&gt;
+&lt;/method&gt;
 
 &lt;TestSuite&gt;
     &lt;TestCase&gt;
@@ -617,7 +616,7 @@
 &lt;include href="lzunit"/&gt;
 &lt;simplelayout axis="y" spacing="10"/&gt;
 
-&lt;script&gt;<![CDATA[
+&lt;method event="oninit"&gt;
 
 var a = new Array(10);
 
@@ -625,7 +624,7 @@
     a[i] = Math.floor(Math.random()*101);
     }
 
-]]>&lt;/script&gt;
+&lt;/method&gt;
 
 &lt;TestSuite&gt;
     &lt;TestCase&gt;
@@ -650,7 +649,7 @@
 &lt;include href="lzunit"/&gt;
 &lt;simplelayout axis="y" spacing="10"/&gt;
 
-&lt;script&gt;<![CDATA[
+&lt;method event="oninit"&gt;
 
 var a = new Array(10);
 
@@ -658,7 +657,7 @@
     a[i] = Math.floor(Math.random()*101);
     }
 
-]]>&lt;/script&gt;
+&lt;/method&gt;
 
 &lt;TestSuite&gt;
     &lt;TestCase&gt;
@@ -683,7 +682,7 @@
 &lt;include href="lzunit"/&gt;
 &lt;simplelayout axis="y" spacing="10"/&gt;
 
-&lt;script&gt;<![CDATA[
+&lt;method event="oninit"&gt;
 
 var a = new Array(10);
 
@@ -697,7 +696,7 @@
 
 Debug.write( a[0], 'lowest \n', a[1], '\n', a[2], '\n', a[3], '\n', a[4], 
'\n', a[5], '\n', a[6], '\n', a[7], '\n', a[8], '\n', a[9], 'highest');
     
-]]>&lt;/script&gt;
+&lt;/method&gt;
 
 &lt;TestSuite&gt;
     &lt;TestCase&gt;


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to