Can anyone tell if finally is always executed after a test times out or not.
[Timeout(1000)][TestMethod]
public void test()
{
try
{
System.Threading.Thread.Sleep(2000);
}
finally
{
//do something
}
}
Can anyone tell if finally is always executed after a test times out or not.
[Timeout(1000)][TestMethod]
public void test()
{
try
{
System.Threading.Thread.Sleep(2000);
}
finally
{
//do something
}
}
If possible, use the TestCleanUp method in order to do work after the test if it is subject to timeouts.
Finally is executed always, doesn't matter if u have try/catch/ block, it is executed when any of those are finished