Skip to content

Is there a way to adjust the "Class" property after test execution #848

Open

Description

@bernd5

Hello,
I'd like to adjust the "Class" or some other column in VS Test Explorer after test execution with a simple text:
grafik

I would like to see there something like the exception class (FeatureXYZNotImplementedException). The text should be adjustable.

My tests are based on [TestCaseSource(nameof(TestFiles))].

The main reason for this is that I want to get more outcome states: not just "fail" and "pass".

Activity

  1. OsirisTerje commented on Apr 24, 2021

    @OsirisTerje
    Member

    I am not sure I understand what you're looking for. You can tweak the reported names to a certain degree using the name formats, see Tricks and Traps in the adapter docs, but otherwise we don't control how the test explorer UI displays the tests.

  2. bernd5 commented on Apr 24, 2021

    @bernd5
    Author

    As you know, I use very much the TestCaseSource - which is super great.
    What I want now is some way to report more information as just "pass" or "fail" to the test explorer depending on the test outcome / test result. I can't fill it during test discovery.

    So I would like to write for example:

    TestContext.CurrentContext.Test.ClassName = "MyClass";

    Any other column is okay, too. It should just be sortable in VS. Is there any way to achieve this?

    What I tried already:
    I replaced the TestAdapter class and changed the reflection based class property. But the data is not reported/copied back to VS.

    I opened an issue at developercommunity.visualstudio.com, too.
    https://developercommunity.visualstudio.com/t/extension-for-test-explorer-error-category/1402579?from=email&viewtype=all#T-ND1405969

  3. OsirisTerje commented on Apr 24, 2021

    @OsirisTerje
    Member

    I see your point, it's a good idea. And I think we need the changes first in Test Explorer and its interface, then it should be doable from the adapter/framework. I upvoted your devcom issue :-)

  4. added
    External
    on Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExternalReportedToMSVS Issueis:question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions