lzunit-$4.lzx

<canvas debug="true" width="100%">
 <debug y="150"/>
  <include href="lzunit"/>

  <dataset name="places">
    <country name="U.S.">
      <state code="CA" capitol="Sacramento">
        <city>San Francisco</city>
        <city>Los Angeles</city>
        <city>San Diego</city>
      </state>
      <state code="NJ" capitol="Trenton">
        <city>Newark</city>
      </state>
      <state code="NY" capitol="Albany">
        <city>Buffalo</city>
        <city>New York City</city>
      </state>
    </country>
  </dataset>
    
  <TestSuite>
    <TestCase>
      <attribute name="start" value="'places:/country[1]'"/>
      <datapointer name="nav" xpath="$once{parent.start}"/>
      <method name="setUp">
        // Move pointer to first state in selected country
        nav.selectChild()
      </method>

      <method name="tearDown">
        // Reset pointer to starting position
        nav.setAttribute("xpath", start)
      </method>

      <method name="testsettext">
        assertTrue(nav.selectChild())
        assertTrue(nav.selectNext())

        var oldText = nav.getNodeText()
        nav.setNodeText('Oakland')
        assertEquals('Oakland', nav.xpathQuery('text()'))
        nav.setNodeText(oldText)
        assertEquals(oldText, nav.getNodeText())
      </method>

      <method name="testBumpChild">
        assertTrue(nav.selectNext(2))
        assertEquals(2, nav.getNodeCount())
        assertTrue(nav.selectChild())
        nav.deleteNode()
        assertFalse('Buffalo'==nav.getNodeText())
        assertTrue(nav.selectParent())
        assertEquals(1, nav.getNodeCount())
      </method>
      <method name="addTests"> 
          this.addTest("testsettext");
          this.addTest("testBumpChild");
      </method> 
    </TestCase>
  </TestSuite>
</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2007, 2008 Laszlo Systems, Inc.  All Rights Reserved.                   *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->

Cross References

Includes

Named Instances