I am writing coded ui tests and I have the application open if it is not already open. Then if one of them fails I close the application the thing is I have multiple tests in mu
IMPORTANT
Someone who is using base class can do assembly cleanup there as well
[TestClass]
public class Page : PageContract, IWindowControlAccess
{
[AssemblyCleanup()]
public static void ApplicationCleanup()
{
Cleanup();
}
}
Two important things here 1. [TestClass] attribute at the base is MANDATORY
2. signature of ApplicationCleanup see its a static method
That's it you are done. I had hard time struggling and debugging it.