mrtentje
mrtentje

Reputation: 1422

Extend Visual Studio 2012 Test Explorer with extra information

As part of some research I am writing an extension for the Microsoft Visual Studio Unit Testing Framework with a custom testing type, like described here. I have created a custom attribute, but I want to show some additional information in the Test Explorer about the executed test from my custom attribute.

I was also wondering if there is any way to show information of all unit tests (so from my custom attribute, but also from the default Visual Studio Unit Testing Framework attributes) that were executed in the past. So I can show the information from these tests in graphs etc.

Does anybody know a good solution to achieve this?

UPDATE 1 What I mean is something like this:

enter image description here

Upvotes: 9

Views: 1954

Answers (2)

Patrick Tseng
Patrick Tseng

Reputation: 264

Are you trying to show additional traits of tests in the Test Explorer? If so, you can use the "Group by Traits" supported added in the Visual Studio 2012 Update 1 (ref detail at http://blogs.msdn.com/b/somasegar/archive/2012/11/26/visual-studio-2012-update-1-now-available.aspx, download from http://www.microsoft.com/en-us/download/details.aspx?id=35774).

In short, you can decorate your test with something like

    [TestMethod]
    [TestCategory("SpecialTestType")]
    [TestProperty("XXX","YYY")]
    public void TestMethod1()
    {
    }

Once this test is discovered again, choose "Group By Traits" (toolbar in the TextExplorer tool window) shall group tests based on your traits (e.g. SpecialTestType, XXX).

Upvotes: 7

mrtentje
mrtentje

Reputation: 1422

Console.WriteLine did the job... The user can click on 'output' and sees the output...

Upvotes: 4

Related Questions