continue on assert

Is there any way to continue test after Assert? .. I need to see all cases which the assert causes.

foreach (var ex in data)
{
     Assert.AreEqual(ex1, ex, msg);
}
Jon Skeet
people
quotationmark

No, you can't - Assert will throw an exception if it fails, and you can't just keep going after the exception. You could catch the exceptions, and then add them into a collection... but it's not terribly nice.

If you're trying to basically test several different cases, most modern unit test frameworks have ways of parameterizing tests so that each case ends up as a separate test, with separately-reported pass/failure criteria. We don't know which framework you're using or what the different cases are here, but if you could give more context, we could try to help more...

people

See more on this question at Stackoverflow