Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>VS essentially offers this ability for free by generating the TRX file to summarize the results of a test run. There are a number of different ways to run all tests in a project but pick one and off mstest will go running each method with the [TestMethod] attribute and producing a UnitTestResult in the results file. </p> <p>What you're asking for is essentially what the Test Results window shows you after a completed Test Run. If you're looking for something external to VS, you could always run a simple XSLT transform against the Test Results (.trx) file giving you a customized summary. Here's a very rough sample which proofs the concept, generating an HTML document containing an unordered list with a list item (test name and result) for each unit test:</p> <pre><code>&lt;?xml version='1.0'?&gt; &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:vs="http://microsoft.com/schemas/VisualStudio/TeamTest/2006"&gt; &lt;xsl:template match="/"&gt; &lt;html&gt; &lt;head&gt; &lt;style type="text/css"&gt; body { font-family: verdana; font-size: 12px; } .pass { color: green; } .nopass { color: red; } h1 { font-size: 13px; margin: 3px; } ul { margin: 3px 20px 3px 40px; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;Test Results&lt;/h1&gt; &lt;ul&gt; &lt;xsl:apply-templates select="//vs:Results//vs:UnitTestResult" /&gt; &lt;/ul&gt; &lt;/body&gt; &lt;/html&gt; &lt;/xsl:template&gt; &lt;xsl:template match="vs:UnitTestResult" &gt; &lt;li&gt; &lt;xsl:value-of select="@testName" /&gt; &amp;#160; &lt;xsl:variable name="Result"&gt; &lt;xsl:choose&gt; &lt;xsl:when test="@outcome='Passed'"&gt;pass&lt;/xsl:when&gt; &lt;xsl:otherwise&gt;nopass&lt;/xsl:otherwise&gt; &lt;/xsl:choose&gt; &lt;/xsl:variable&gt; &lt;b class="{$Result}"&gt; &lt;xsl:value-of select="@outcome" /&gt; &lt;/b&gt; &lt;/li&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload