-
Notifications
You must be signed in to change notification settings - Fork 290
Closed
Milestone
Description
Copied from #Microsft/vstest/548.
Description
In the TestCleanup method, the TestContext.CurrentTestOutcome property is always InProgress rather than the actual current test outcome.
Using the old test framework (bundled with VS, New > Project > Unit Test) the outcome is set correctly.
Steps to reproduce
using Microsoft.VisualStudio.TestTools.UnitTesting;
[TestClass]
public class MyTestClass
{
public TestContext TestContext { get; set; }
[TestMethod]
public void PassTest()
{
Assert.IsTrue(true);
}
[TestMethod]
public void InconclusiveTest()
{
Assert.Inconclusive();
}
[TestMethod]
public void FailTest()
{
Assert.Fail();
}
[TestCleanup]
public void TestCleanup()
{
System.Console.WriteLine($"{TestContext.TestName}: {TestContext.CurrentTestOutcome}");
}
}Expected behavior
TestContext.CurrentTestOutcome is set to the actual outcome type of the current test.
Image taken when executing the code above using the old VS-bundled framework.
Actual behavior
TestContext.CurrentTestOutcome is always InProgress
Image taken when executing the code above using the new NuGet package framework.
Environment
| Version | |
|---|---|
| OS | Windows 10 Enterprise build 14393 |
| IDE | Visual Studio Enterprise 2015 Update 3 |
| Target framework | 4.5.2 |
MSTest.TestAdapter |
1.1.12 |
MSTest.TestFramework |
1.1.11 |
Metadata
Metadata
Assignees
Labels
No labels

