Visual Studio 2012 Tester Test

In Visual Studio 2010, presenting test results was able to display unit test at this time. When using Visual Studio 2012, I was not able to identify the unit test that runs in Test Explorer. How can I detect unit test in Visual Studio 2012 Test Explorer?

+6
source share
1 answer

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

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

IFrameworkHandle has methods for registering test status

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

Thus, it is possible for the test window to display an icon during the test. However, I built a test device using the wizard-created class library for MS-Test, as I expect this to be the most complete function of all 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 worked for 10 seconds. Therefore, I would say that the test window VS2012 [Update 3 RC] does not show the current test. A future update may improve the situation, as it seems quite possible, given the unit test API.

+3
source

Source: https://habr.com/ru/post/943572/


All Articles