home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 December / CMCD1203.ISO / Software / Freeware / Programare / sharpdevelop / 098setup.exe / $INSTDIR / data / SharpUnit / GenerateReport.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2003-10-24  |  2.7 KB  |  74 lines

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2.      
  3. <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  4.     <xsl:template match="TestResults">
  5.         <BODY>
  6.             <H1>Project Report</H1>
  7.             
  8.             <xsl:for-each select="TestAssembly">
  9.                 <H2>Executed tests in assembly <xsl:value-of select="@name"/></H2>
  10.                 <xsl:for-each select="TestSuite">
  11.                         <DIV CLASS="LOCALHEADER">
  12.                             Processed test suite <xsl:value-of select="@name"/>
  13.                         </DIV>
  14.                     <TABLE>
  15.                         <xsl:for-each select="TestCase">
  16.                             <xsl:choose>
  17.                                 <xsl:when test="@succeeded='True'">
  18.                                     <TR><TD>
  19.                                         Passed test <xsl:value-of select="@name"/> <xsl:if test="@description"> : <xsl:value-of select="@description"/></xsl:if>
  20.                                     </TD></TR>
  21.                                 </xsl:when>
  22.                                 <xsl:otherwise>
  23.                                     <TR><TD><DIV CLASS="FAILED">
  24.                                         Failed test <xsl:value-of select="@name"/> <xsl:if test="@description"> : <xsl:value-of select="@description"/></xsl:if>
  25.                                     </DIV></TD></TR>
  26.                                     
  27.                                     <TR><TD><DIV CLASS="FAILED">
  28.                                         Exception got:
  29.                                     </DIV></TD></TR>
  30.                                     
  31.                                     <TR><TD><DIV CLASS="FAILED">
  32.                                         <pre><xsl:value-of select="Exception"/></pre>
  33.                                     </DIV></TD></TR>
  34.                                 </xsl:otherwise>
  35.                             </xsl:choose>
  36.                             <TR><TD>
  37.                                 <DIV CLASS="LIGHT">
  38.                                     Test case execution time : <xsl:value-of select="number(@milliseconds)"/> milliseconds.
  39.                                 </DIV>
  40.                             </TD></TR>
  41.                         </xsl:for-each>
  42.                     </TABLE>
  43.                     <P>
  44.                         <DIV CLASS="LIGHT">
  45.                             Test suite execution time : <xsl:value-of select="number(@milliseconds)"/> milliseconds.
  46.                         </DIV>                    
  47.                     </P>
  48.                     <P>
  49.                         <xsl:choose>
  50.                             <xsl:when test="number(@testssucceeded)>0 and number(@testsfailed)=0">
  51.                                 <DIV CLASS="SUCCEEDEDREPORT">
  52.                                     All tests in <xsl:value-of select="@name"/> succeeded
  53.                                 </DIV>
  54.                             </xsl:when>
  55.                             <xsl:when test="number(@testssucceeded)=0 and number(@testsfailed)>0">
  56.                                 <DIV CLASS="FAILEDREPORT">
  57.                                     All tests in <xsl:value-of select="@name"/> failed
  58.                                 </DIV>
  59.                             </xsl:when>
  60.                             <xsl:otherwise>
  61.                                 <DIV CLASS="FAILEDREPORT">
  62.                                     Some tests in <xsl:value-of select="@name"/> failed
  63.                                 </DIV>
  64.                             </xsl:otherwise>
  65.                         </xsl:choose>
  66.                     </P>
  67.                 </xsl:for-each>
  68.                 Summary: <xsl:value-of select="number(@testssucceeded)+number(@testsfailed)"/> test cases executed, <xsl:value-of select="number(@testssucceeded)"/> passed, <xsl:value-of select="number(@testsfailed)"/> failed.
  69.                 Total Execution time : <xsl:value-of select="number(@milliseconds)"/> milliseconds.
  70.             </xsl:for-each>
  71.         </BODY>
  72.     </xsl:template>
  73. </xsl:transform>
  74.