I am wonder if there is an easy way to finish a test after an Assert has failed. We used to use Galileo for all of our automated tested, but we have moved the Visual Studio Test framework. We had a method that would allow a test to fail, but continue on.
public static bool DoAssertAndContinue(Action assert)
{
try
{
assert();
return true;
}
catch (AssertionException ae)
{
ConfigContext.WriteLine(ae.Message);
return false;
}
}
This is what we used before...and it would be called like this:
assertionResults.Add(Automation.Utils.CommonMethods.DoAssertAndContinue(() => Assert.IsTrue(detail.ValidateName(boo, urns))));
I am just trying to figure out the best way to emulate what we had before without having to refactor all of our tests.
Instead of AssertionException, you should now catch UnitTestAssertException which is the base exception for all mstest assert failures.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With