Controlling execution order of unit tests in Visual Studio
Merge your tests into one giant test will work. To make the test method more readable, you can do something like
[TestMethod]
public void MyIntegratonTestLikeUnitTest()
{
AssertScenarioA();
AssertScenarioB();
....
}
private void AssertScenarioA()
{
// Assert
}
private void AssertScenarioB()
{
// Assert
}
Actually the issue you have suggests you probably should improve the testability of the implementation.
Cmocka - should we all be creating one executable per test for isolating static variables?
Yes, if you have a static variable in the tested object, you need to compile separated tests if they expect a "fresh" test object.
I would do this anyway, each test in a separated executable, since you have a Singleton in your test object.
This is a fine example why the Singleton pattern is an anti-pattern today. It is hard to test.
Is there a way to run unit tests sequentially with MSTests?
There is the notion of an "Ordered Test" in which you can list tests in sequence. It is more geared towards ensuring a certain sequential order, but I can't see how that would be possible if B doesn't wait for A to complete.
Apart from that, it is unfortunate that your tests interfere with each other. There are Setup / TearDown methods that can be used per test such that it may after all be possible to isolate the tests from each other.
Related Topics
How to Write a Viewmodelbase in Mvvm
Best Way to Convert Callback-Based Async Method to Awaitable Task
Programmatic Control of Virtual Desktops in Windows 10
Using Lambda Expressions for Event Handlers
How to Group Windows Form Radio Buttons
C# - Volatile Keyword Usage VS Lock
Is Configurationmanager.Appsettings Available in .Net Core 2.0
How to Know the Size of the String in Bytes
Cannot Implicitly Convert Type 'Int' to 'T'
Ascending/Descending in Linq - Can One Change the Order via Parameter
Convert Rows from a Data Reader into Typed Results
Interfaces VS. Abstract Classes
How to Get Web Page's Content and Save It into the String Variable
C# Get a Control's Position on a Form