Visual Studio 2012 Unit Test Report

Otávio Pereira

I need to create some report of the execution of my unit test cases (quantity of tests passed, failed and ignored). I looked around the internet but I didn't find any way to generate this. Does someone knows a simple (or complex) way to generate a unit test report locally? (I said locally because I have found a solution using the test manager but is not feasible to me righ now).

jessehouwing

There is no option from the Visual Studio UI, but this can be accomplished from the command line. navigate to your solution directory and run the following command from the Visual Studio 2013 command line:

vstest.console.exe /logger:trx .\TestProject\bin\debug\YourUnitTestAssembly.dll

This will create a TestResults folder under your solution root and drop a .trx file. By opening that file into Visual Studio you should see something like this:

enter image description here

The .trx file is easy to parse XML and can be converted into human readable data using an XSLT, as explained in this other question.

Normally Visual Studio creates this file during the run, but deletes it afterwards. It looks like my instance of Visual Studio will actually create such a trx file and keep it in a $(solutionroot)\TestResults\{GUID} directory when I use the Analyze code coverage feature:

enter image description here

enter image description here

To see if your version of Visual studio has the Trx logger installed, run the following command from a Visual Studio command prompt:

enter image description here

Este artículo se recopila de Internet, indique la fuente cuando se vuelva a imprimir.

En caso de infracción, por favor [email protected] Eliminar

Editado en
0

Déjame decir algunas palabras

0Comentarios
Iniciar sesiónRevisión de participación posterior

Artículos relacionados

Usando Java con Microsoft Visual Studio 2012

unit test mocha Visual Studio Code describe is not defined

Difference between Android Instrumentation test and Unit test in Android Studio?

Detect if Visual C++ Redistributable for Visual Studio 2012 is installed

¿Cómo instalar XNA Game Studio en Visual Studio 2012?

Porting Visual Studio VSPackage to SSMS 2012 or 2014

Visual Studio 2012 no carga ningún proyecto

Suivi du temps de compilation .cpp dans Visual Studio 2012

disable error sounds visual studio 2012

Visual Studio 2015 - Распространяемый компонент Report Viewer 2015 - Получение работы Report Viewer "12"

Visual Studio 2012 won't let me debug Implementation of Interface

Microsoft Rdlc Report Designer in Visual Studio 2017

Autogenerate unit test stubs on Android studio

Find all commented line in visual studio 2012

Error loading Visual Studio 2012 and 2015 projects

SSRS Report Date Format Switching to US in Visual Studio 2012

Visual Studio 2012 and 2017 behavior for same website

Visual Studio C # unit test System.Net.Http.Formatting ensamblado no cargado

Referencia que no funciona en Visual Studio 2012

Razor intellisense not working in Visual Studio 2012

Ошибка необработанного исключения Visual Studio 2012 и Allegro 4

Visual Studio 2012 Intellisence Icon - Icono desconocido

TF31003 при попытке подключиться к Visual Studio Team Services из VS 2012

generador de consultas visual studio 2012

DBContext не распознается в Visual Studio 2012 Express для Интернета

Cambiar de Visual Studio-2012 a Visual Studio-2010

N Unit Visual Studio 2017 Test Explorer no encuentra pruebas

Visual Studio 2012 Ultimate Edition с записью веб-теста

Плагин Jenkins JUnit Test Result Report сообщает, что с шаблоном '** / unit-tests.xml' были найдены 4 файла (ов) отчета о тестировании?