The TestMethodExAttribute extends the TestMethodAttribute and enables custom execution.
Other attributes like RetryAttribute can then be added to control execution.
input - none.
- add a NuGet reference to the MSTestEx package.
- create / open an MSTestV2 based test project.
- add the following:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MSTest.TestFramework.Extensions.TestMethodEx;
namespace UnitTestProject2
{
[TestClass]
public class UnitTest1
{
[TestMethodEx]
public void TestMethod1()
{
// Test logic
}
}
}
MSTestEx v1.0.2