//**************************************************************************
//
//
//                       National Institute Of Standards and Technology
//                                    DTS Version 1.0
//         
//                           HTMLTableRowElement Interface
//**************************************************************************

function HTMLTableRowElement()
{
   var tests = new Array (HTML0001HTRE(),HTML0002HTRE(),HTML0003HTRE(),HTML0004HTRE(),HTML0005HTRE(),HTML0006HTRE(),HTML0007HTRE(),HTML0008HTRE(),HTML0009HTRE(),HTML0010HTRE(),HTML0011HTRE(),HTML0012HTRE(),HTML0013HTRE(),HTML0014HTRE());
   return tests;
}

//------------------------ test case HTML-0001HTRE ------------------------
//
// Testing feature - The rowIndex attribute specifies the index of this row
//                   relative to the entire table
//
// Testing approach - Retrieve the third TR element of the testing
//                    document and examine the "rowIndex" element.
//
// Semantic Requirements: 1 
//
// Last modification date - November 3, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------

 function HTML0001HTRE()
 {
   var computedValue = "";
   var expectedValue = 1;
   var results = "";
   var testNode = "";

    results = new testResults("HTML0001HTRE");
    results.description = "The \"rowIndex\" attribute specifies the "+ 
                          "index of this row relative to the entire "+
                          "table.";
//
// Retrieve targeted data.
//
      testNode = new HTMLNodeObject(TR,THIRD);
//
// examine its "rowIndex" attribute.
//
     computedValue = testNode.node.rowIndex;	
//
// Write out results 
//
      resetHTMLData();
      results.expected = expectedValue;
      results.actual = computedValue;

    return results;
}
//------------------------ End test case HTML-0001HTRE -------------------------
//
//-------------------------  test case HTML-0002HTRE ---------------------------
//
// Testing feature - The sectionRowIndex attribute specifies the index of 
//                   this row relative to the current section (test 
//                   relative for THEAD section) 
//
// Testing approach - Retrieve the first TR element of the testing
//                    document and examine the "sectionRowIndex" element.
//
// Semantic Requirements: 2 
//
// Last modification date - November 3, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------

 function HTML0002HTRE()
 {
   var computedValue = "";
   var expectedValue = 0;
   var results = "";
   var testNode = "";

    results = new testResults("HTML0002HTRE");
    results.description = "The \"sectionRowIndex\" attribute specifies "+
                          "the index of this row relative to the "+
                          "current section (test for THEAD section)";
//
// Retrieve targeted data.
//
      testNode = new HTMLNodeObject(TR,FIRST);
//
// examine its "sectionRowIndex" attribute.
//
      computedValue = testNode.node.sectionRowIndex;
//
// Write out results
//
      results.expected = expectedValue;
      results.actual = computedValue;

    return results;
}
//------------------------ End test case HTML-0002HTRE -------------------------
//
//-------------------------  test case HTML-0003HTRE ---------------------------
//
// Testing feature - The sectionRowIndex attribute specifies the index of
//                   this row relative to the current section (test
//                   relative for TFOOT section)
//
// Testing approach - Retrieve the second TR element of the testing
//                    document and examine the "sectionRowIndex" element.
//
// Semantic Requirements: 2 
//
// Last modification date - November 3, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------

 function HTML0003HTRE()
 {
   var computedValue = "";
   var expectedValue = 0;
   var results = "";
   var testNode = "";

    results = new testResults("HTML0003HTRE");
    results.description = "The \"sectionRowIndex\" attribute specifies "+
                          "the index of this row relative to the "+
                          "current section (test for TFOOT section)";
//
// Retrieve targeted data.
//
      testNode = new HTMLNodeObject(TR,SECOND);
//
// examine its "sectionRowIndex" attribute.
//
      computedValue = testNode.node.sectionRowIndex;
//
// Write out results
//
      results.expected = expectedValue;
      results.actual = computedValue;

    return results;
}
//------------------------ End test case HTML-0003HTRE -------------------------
//
//-------------------------  test case HTML-0004HTRE ---------------------------
//
// Testing feature - The sectionRowIndex attribute specifies the index of
//                   this row relative to the current section (test
//                   relative for TBODY section)
//
// Testing approach - Retrieve the fifth TR element of the testing
//                    document and examine the "sectionRowIndex" element.
//
// Semantic Requirements: 2 
//
// Last modification date - November 3, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------

 function HTML0004HTRE()
 {
   var computedValue = "";
   var expectedValue = 2;
   var results = "";
   var testNode = "";

    results = new testResults("HTML0004HTRE");
    results.description = "The \"sectionRowIndex\" attribute specifies "+
                          "the index of this row relative to the "+
                          "current section (test for TBODY section)";
//
// Retrieve targeted data.
//
      testNode = new HTMLNodeObject(TR,FIFTH);
//
// examine its "sectionRowIndex" attribute.
//
      computedValue = testNode.node.sectionRowIndex;
//
// Write out results
//
      results.expected = expectedValue;
      results.actual = computedValue;

    return results;
}
//------------------------ End test case HTML-0004HTRE -------------------------
//
//------------------------  test case HTML-0005HTRE ----------------------------
//
// Testing feature - The cells attribute is the collection of cells in 
//                   this row. 
//
// Testing approach - Retrieve the first TR element of the testing
//                    document and examine the length of the "cells" element.
//
// Semantic Requirements: 3 
//
// Last modification date - November 3, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------

 function HTML0005HTRE()
 {
   var computedValue = "";
   var expectedValue = 6;
   var results = "";
   var testNode = "";

    results = new testResults("HTML0005HTRE");
    results.description = "The \"cells\" attribute contains the "+
                          "collection of the cells in this row.";
//
// Retrieve targeted data.
//
      testNode = new HTMLNodeObject(TR,FIRST);
//
// examine its "cells" attribute.
//
      computedValue = testNode.node.cells.length;
//
// Write out results
//
      results.expected = expectedValue;
      results.actual = computedValue;

    return results;
}
//------------------------ End test case HTML-0005HTRE -------------------------
//
//------------------------  test case HTML-0006HTRE ----------------------------
//
// Testing feature - The "align" attribute contains the horizontal
//                   alignment of the data within the cells of
//                   this row. 
//
// Testing approach - Retrieve the first TR element of the testing
//                    document and examine the "align" element.
//
// Semantic Requirements: 4
//
// Last modification date - November 3, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------

 function HTML0006HTRE()
 {
   var computedValue = "";
   var expectedValue = "CENTER";
   var results = "";
   var testNode = "";

    results = new testResults("HTML0006HTRE");
    results.description = "The \"align\" attribute contains the "+
                          "horizontal alignment of data within "+
                          "the cells of this row.";
//
// Retrieve targeted data.
//
      testNode = new HTMLNodeObject(TR,FIRST);
//
// examine its "align" attribute.
//
      computedValue = testNode.node.align;
      computedValue = computedValue.toUpperCase();
//
// Write out results
//
      results.expected = expectedValue;
      results.actual = computedValue;

    return results;
}
//------------------------ End test case HTML-0006HTRE -------------------------
//
//------------------------  test case HTML-0007HTRE ----------------------------
//
// Testing feature - the "bgColor" attribute contains the background color 
//                   for the rows.
//
// Testing approach - Retrieve the first TR element of the testing
//                    document and examine the "bgColor" element.
//
// Semantic Requirements: 5 
//
// Last modification date - November 3, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------

 function HTML0007HTRE()
 {
   var computedValue = "";
   var expectedValue = "#00FFFF";
   var results = "";
   var testNode = "";

    results = new testResults("HTML0007HTRE");
    results.description = "The \"bgColor\" attribute contains the "+
                          "background color for the rows.";
//
// Retrieve targeted data.
//
      testNode = new HTMLNodeObject(TR,FIRST);
//
// examine its "bgColor" attribute.
//
      computedValue = testNode.node.bgColor;
      computedValue = computedValue.toUpperCase();
//
// Write out results
//
      results.expected = expectedValue;
      results.actual = computedValue;

    return results;
}
//------------------------ End test case HTML-0007HTRE -------------------------
//
//------------------------  test case HTML-0008HTRE ----------------------------
//
// Testing feature - the "ch" attribute contains the alignment character for
//                   cells in a column.
//
// Testing approach - Retrieve the first TR element of the testing
//                    document, set the "ch" element and determine if it
//                    was set correctly.
//
// Semantic Requirements: 6 
//
// Last modification date - November 3, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------

 function HTML0008HTRE()
 {
   var computedValue = "";
   var expectedValue = ".";
   var results = "";
   var testNode = "";

    results = new testResults("HTML0008HTRE");
    results.description = "The \"ch\" attribute contains the "+
                          "alignment character for cells in "+
                          "a column";
//
// Retrieve targeted data.
//
      testNode = new HTMLNodeObject(TR,FIRST);
//
// examine its "ch" attribute.
//
      testNode.node.ch = ".";
      computedValue = testNode.node.ch;
      computedValue = computedValue.toUpperCase();
//
// Write out results
//
      results.expected = expectedValue;
      results.actual = computedValue;

    return results;
}
//------------------------ End test case HTML-0008HTRE -------------------------
//
//------------------------  test case HTML-0009HTRE ----------------------------
//
// Testing feature - the "chOff" attribute contains the offset of alignment
//                   character. 
//
// Testing approach - Retrieve the first TR element of the testing
//                    document, set the "chOff" element and determine if it
//                    was set correctly.
//
// Semantic Requirements: 7 
//
// Last modification date - November 3, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------

 function HTML0009HTRE()
 {
   var computedValue = "";
   var expectedValue = "0";
   var results = "";
   var testNode = "";

    results = new testResults("HTML0009HTRE");
    results.description = "The \"chOff\" attribute contains the "+
                          "the offset of alignment character.";
//
// Retrieve targeted data.
//
      testNode = new HTMLNodeObject(TR,FIRST);
//
// examine its "chOff" attribute.
//
      testNode.node.chOff = "0";
      computedValue = testNode.node.chOff;
//
// Write out results
//
      results.expected = expectedValue;
      results.actual = computedValue;

    return results;
}
//------------------------ End test case HTML-0009HTRE -------------------------
//
//------------------------  test case HTML-0010HTRE ----------------------------
//
// Testing feature - the "vAlign" attribute contains the vertical alignment of
//                   data within the cells of this row.
//
// Testing approach - Retrieve the first TR element of the testing
//                    document and examine the "vAlign" element.
//
// Semantic Requirements: 8 
//
// Last modification date - November 3, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------

 function HTML0010HTRE()
 {
   var computedValue = "";
   var expectedValue = "MIDDLE";
   var results = "";
   var testNode = "";

    results = new testResults("HTML0010HTRE");
    results.description = "The \"vAlign\" attribute contains the "+
                          "vertical alignment of data within the "+
                          "cells of this row.";
//
// Retrieve targeted data.
//
      testNode = new HTMLNodeObject(TR,FIRST);
//
// examine its "vAlign" attribute.
//
      computedValue = testNode.node.vAlign;
      computedValue = computedValue.toUpperCase();
//
// Write out results
//
      results.expected = expectedValue;
      results.actual = computedValue;

    return results;
}
//------------------------ End test case HTML-0010HTRE -------------------------
//
//------------------------  test case HTML-0011HTRE ----------------------------
//
// Testing feature - the "insertCell(index)" method inserts an empty TD
//                   cell into this row (test for actual insertion).
//
// Testing approach - Retrieve the first TR element of the testing
//                    document.  Invoke the "insertCell(index)" method with 
//                    index = 3.  This should result in a cell being inserted 
//                    at location number 4.  Further test for the length of 
//                    the cell collection to check for actual insertion.
//
// Semantic Requirements: 9
//
// Last modification date - November 4, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------

 function HTML0011HTRE()
 {
   var computedValue = "";
   var expectedValue = 7
   var results = "";
   var testNode = "";

    results = new testResults("HTML0011HTRE");
    results.description = "The \"insertCell(index)\" method inserts an "+
                          "empty TD cell into this row (test for actual "+
                          "insertion).";
//
// Retrieve targeted data.
//
      testNode = new HTMLNodeObject(TR,FIRST);
//
// invoke its "insertCell(index)" method with index = 3.
//
      testNode.node.insertCell(FOURTH);
      computedValue = testNode.node.cells.length;
//
// Write out results
//
//      resetHTMLData();
      results.expected = expectedValue;
      results.actual = computedValue;

    return results;
}
//------------------------ End test case HTML-0011HTRE -------------------------
//
//------------------------  test case HTML-0012HTRE ----------------------------
//
// Testing feature - the "insertCell(index)" method inserts an empty TD
//                   cell into this row (test for insertion at the
//                   correct location).
//
// Testing approach - Retrieve the first TR element of the testing
//                    document.  Invoke the "insertCell(index)" method with 
//                    index = 3.  This should result in a cell being inserted 
//                    at location number 4.  Further test for the length of the
//                    of the collection to check for actual insertion.
//
// Semantic Requirements: 9
//
// Last modification date - November 4, 1999
//
// Written by:Mark LaRoy Zimmerman 
//----------------------------------------------------------------------------

 function HTML0012HTRE()
 {
   var computedValue = "";
   var expectedValue = null;
   var results = "";
   var testNode = "";
   var cellObject = "";

    results = new testResults("HTML0012HTRE");
    results.description = "The \"insertCell(index)\" method inserts an "+
                          "empty TD cell into this row (test for insertion "+
                          "at correct location).";
//
// Retrieve targeted data.
//
      testNode = new HTMLNodeObject(TR,FIRST);
//
// Invoke its "insertCell(index)" method with index = 3.
//
       testNode.node.insertCell(FOURTH);
       cellObject = testNode.node.cells(FOURTH);
       computedValue = cellObject.firstChild;
//
// Write out results
//
      resetHTMLData();
      results.expected = expectedValue;
      results.actual = computedValue;

    return results;
}
//------------------------ End test case HTML-0012HTRE -------------------------
//
//------------------------  test case HTML-0013HTRE ----------------------------
//
// Testing feature - the "deleteCell(index)" method deletes a cell from
//                   this row (test for actual deletion).
//
// Testing approach - Retrieve the first TR element of the testing
//                    document.  Invoke the "deleteCell(index)" method with 
//                    index = 3.  This should cause the cell at location number 4 
//                    be deleted.  Further test for the new length of the cells
//                    collection to ensure that a cell was deleted.
//
// Semantic Requirements: 10
//
// Last modification date - November 4, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------

 function HTML0013HTRE()
 {
   var computedValue = "";
   var expectedValue = 5;
   var results = "";
   var testNode = "";
   var rowCollection = "";
   var rowObject = "";

    results = new testResults("HTML0013HTRE");
    results.description = "The \"deleteCell(index)\" method deletes a cell "+
                          "from this row (test for actual deletion).";
//
// Retrieve targeted data.
//
      testNode = new HTMLNodeObject(TR,FIRST);
//
// invoke its "deleteCell(index)" method
// with index = 3.
//
      testNode.node.deleteCell(FOURTH);
      computedValue = testNode.node.cells.length;
//
// Write out results
//
      resetHTMLData();
      results.expected = expectedValue;
      results.actual = computedValue;

    return results;
}
//------------------------ End test case HTML-0013HTRE -------------------------
//
//------------------------  test case HTML-0014HTRE ----------------------------
//
// Testing feature - the "deleteCell(index)" method deletes a cell from
//                   this row (test for deletion at correct place).
//
// Testing approach - Retrieve the first TR element of the testing
//                    document.  Invoke the "deleteCell(index)" method with 
//                    index = 3.  This should cause the cell at location number 
//                    4 be deleted.  Further test for the new length of the cells
//                    collection to ensure that a cell was deleted.  All cells
//                    after cell number four should shift up one position now.
//
// Semantic Requirements: 10
//
// Last modification date - November 4, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------

 function HTML0014HTRE()
 {
   var computedValue = "";
   var expectedValue = "5 GENDER";
   var results = "";
   var testNode = "";
   var objectLength = "";

    results = new testResults("HTML0014HTRE");
    results.description = "The \"deleteCell(index)\" method deletes a cell "+
                          "from this row (test for correct cell deletion).";
//
// Retrieve targeted data.
//
      testNode = new HTMLNodeObject(TR,FIRST);
//
// invoke its "deleteCell(index)" method
// with index = 3.
//
      testNode.node.deleteCell(FOURTH);
      objectLength = testNode.node.cells.length;
      thirdCell = testNode.node.cells(FOURTH).firstChild.data;
      computedValue = objectLength+" "+thirdCell.toUpperCase();
//
// Write out results
//
      resetHTMLData();
      results.expected = expectedValue;
      results.actual = computedValue;

    return results;
}
//------------------------ End test case HTML-0014HTRE -------------------------