I'm using SpecFlow with Coded UI to create automated tests for a WPF application.
I have multiple assertions inside a "Then" step and a couple of them fails. When an assertion fails, the test case is failed and the execution is stopped. I want my test case to go ahead till the end with the execution and when the last step is performed if any failed assertions were present during the execution I want to fail the whole test case.
I found only partial solutions:
try
{
Assert.IsTrue(condition)
}
catch(AssertFailedException ex)
{
Console.WriteLine("Assert failed, continuing the run");
}
In this case the execution goes till the end, but the test case is marked as passed.
Thanks!