mardi 5 janvier 2021

How to force quit the execution of a single MSTest project without quitting the execution of the other test projects

Assume there are the following MSTest projects in a .NET framework solution:

SampleTestProject1

SampleTestProject2

SampleTestProject3

In the assembly cleanup of SampleTestProject2 we want to kill the current process (because of some issue, which I don't want to analyze further in this post). However, we only have the need to kill the SampleTestProject2, not the whole test execution.

If this Process.GetCurrentProcess().Kill(); gets executed from the SampleTestProject2, then the whole test execution will stop and the other test projects in the queue won't run. Instead, I want to stop the execution of SampleTestProject2 and continue with the remaining test projects.

Any ideas?

Aucun commentaire:

Enregistrer un commentaire