1

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()
    {
    }
}
khargoosh
  • 1,450
  • 15
  • 40
  • Not sure if this is a duplicate. I need the entire test class to run sequentially, as `Prepare()` and `Cleanup()` differ between integration tests. Each class will have a number of testable scenarios. – khargoosh May 22 '20 at 01:30

0 Answers0