Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6970125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:40:13+00:00 2026-05-27T16:40:13+00:00

I found the TestExecution class, which exposes a bunch of events that would be

  • 0

I found the TestExecution class, which exposes a bunch of events that would be incredibly helpful. However, I can’t find a reference to it other than MSDN’s documentation, and the documentation doesn’t provide any hints as far as to how it is used, or how I might get a reference to an instance during a test run.

Looking with .NET Reflector wasn’t helpful either – TestExecution is implemented by one other class, UnitTestExecution, which is internal. I could not find any other references to either class throughout any of the Microsoft.VisualStudio.QualityTools.* libraries, neither in the form of further implementations nor references as property types in any other classes.

How might I gain access to these events?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:40:13+00:00Added an answer on May 27, 2026 at 4:40 pm

    An TestExecution instance is provided to you when implementing a custom TestExtensionExecution. It provides an Initialize method, which you can override to subscribe to the test events.

    This is usually part of an implementation of a custom test attribute in MSTest.

    Edit
    To create your own test extension, start with creating a new attribute that derives from Microsoft.VisualStudio.TestTools.UnitTesting.TestClassExtensionAttribute, which is an abstract class requiring you to provide a TestExtensionExecution via the GetExtension() method.

    Apply your attribute to one of your test methods and you should be able to subscribe to those events during the test (inside your TestExtensionExecution implementation returned by the attribute)

    Note that you also have to implement a ITestMethodInvoker which you should be able to create from the TetMethodInvokerContext.TestMethodInfo property supplied to the TestExtensionExecute.CreateTestMethodInvoker method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Found a piece of code today, that I find a little smelly... TMyObject.LoadFromFile(const filename:
Found a bunch of other threads about comboboxes in WPF datagrid, but none that
Found more than 10 tutorials to cursors but I can't understand that. My question
Found the following in an Oracle-based application that we're migrating (generalized) : SELECT Table1.Category1,
found this regex: insert every 10 characters: $text = preg_replace(|(.{10})|u, \${1}. , $text); can
I found this open-source library that I want to use in my Java application.
Found on JavaScript SDK http://developers.facebook.com/docs/reference/javascript/ ... Asynchronous Loading -------------------------------- This code loads the SDK
found that code to display html format text to dynamic textfield in as3: var
Found the function which position the image(s) in the multiscaleimage... but I'm not sure
Found myself trying to find a link to an official definition of this design

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.