The Visual Studio unit test results can be easily seen in the test results window, or the TFS publish test results can be used:
However, if you want to use mstest.exe to run the test DLL or test list file) to parse the test result file, you need to face the complicated structure of the TRX file:
Every time a unit test is run, IDE will generate the testresults folder (this folder is the same as the test list file *. vsmdi) to save the TRX file:
I also wrote about parsing this file.CodeAnd generate an HTML report and send it by email. Recently, an open-source tool was found to generate a test report in HTML format that is easy to read. The address is as follows:
Http://trx2html.codeplex.com/
Download, decompress, run the trx2html.exe directly in the command line, and pass in the TRX test result file:
After the execution is complete, the test report in the .html file format will be generated under the same level directory:
Compare it with our test code:
The description content and error information are displayed in the report.