I'm writing integration tests in Visual Studio 2019 for a c# network library. Because the library requires access to a specific port, the tests can only be run sequentially, including Prepare()
and Cleanup()
methods.
Is there a way to force a group of test classes (the group of integration tests) to run sequentially?
I've only been able to add these tests to my test project as unit tests as I see no other options when creating new test projects or adding tests. Do I need to adopt a different test framework to accomplish this?
The format of my integration test classes is generally:
[TestClass]
public class IntegrationTests_TestClass01
{
[ClassInitialize]
public static void Prepare(TestContext context)
{
}
[TestMethod]
public void IntegrationTests_TestMethod01()
{
}
[ClassCleanup]
public static void Cleanup()
{
}
}