Adding NUnit MultipleAssertException to default fail exceptions#501
Conversation
|
Hi, @algirdasN , thank you for your contribution! You're correct. Since But I want to clarify a little bit about how all that works with NUnit.
That's not entirely true. We don't use As long as the test contains at least one failed assertion and doesn't throw anything besides exceptions originating from But what is affected by that property are steps and fixtures. And that's where lacking To illustrate all this, let's consider the following test: [AllureNUnit]
class Pr501Tests
{
[Test]
public void MultipleAssertTest()
{
AllureApi.Step(
"Step with multiple assertions",
() => Assert.Multiple(() => {
Assert.That(1 + 1, Is.EqualTo(3));
Assert.That(1 + 1, Is.EqualTo(1));
})
);
}
}It's shown in the report as follows:
Note the test's status is All those only apply to NUnit. Allure SpecFlow and Allure Reqnroll both use the general algorithm that relies on |

Context
NUnit provides a method to perform multiple assertions without interrupting by failure. If any failures occur, a MultipleAssertException is thrown after all assertions have finished. Currently this exception is not included in default fail exceptions and this causes Allure to mark such test failures as broken tests.
Read more about multiple asserts here - https://docs.nunit.org/articles/nunit/writing-tests/assertions/multiple-asserts.html