Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2012 Test Explorer Test In Progress

In Visual Studio 2010 the Test Results view was able to display the unit test currently in progress. While using Visual Studio 2012 I have not been able to identify the unit test that is being executed in the Test Explorer. How would I identify the unit test in progress in Visual Studio 2012 Test Explorer?

like image 320
Mark Ward Avatar asked Apr 24 '13 21:04

Mark Ward


1 Answers

The interface for ITestExecutor, which is a required interface for a unit test plugin shows that RunTests has a context of IFrameworkHandle

public interface ITestExecutor
{
   void RunTests(IEnumerable<string> sources, IRunContext runContext, IFrameworkHandle frameworkHandle);
   void RunTests(IEnumerable<TestCase> tests, IRunContext runContext, IFrameworkHandle frameworkHandle);
   void Cancel();
}

IFrameworkHandlehas methods for recording the status of the tests

RecordStart(TestCase testCase)
RecordResult(TestResult testResult)
RecordEnd(TestCase testCase, TestOutcome testOutcome)

So it would appear it is possible for the test window to show an icon while the test is running. However, I built a test fixture using a wizard created class library for MS-Test as I expect it would be the most feature complete of all the runners. I added the following test class

[TestClass]
public class UnitTest1
{
    [TestMethod]
    public void TestMethod1()
    {
        Thread.Sleep(10000);
        Assert.IsTrue(true);
    }
}

There was no indication that the test was running for 10 seconds. So I would say that the VS2012's [Update 3 RC] test window does not show the currently running test. A future update may improve the situation as it seems entirely possible given the unit test framework's API.

like image 125
Ritch Melton Avatar answered Oct 03 '22 02:10

Ritch Melton