Allure.NUnit
Allure.NUnit copied to clipboard
Since 3.1.1-beta1 throw new exception in code in method with AllureStep stops discovering steps at all
To Reproduce
Code like this broke all AllureStep
[AllureStep("test")]
public void Test()
{
Console.WriteLine("test");
throw new Exception("test");
Console.WriteLine("test");
}
Expected behavior
Screenshots
Versions
- NUnit: ...
- Allure: 3.1.1-beta1
So.
BAD:
[AllureStep("test")]
public void Test()
{
Console.WriteLine("test");
throw new Exception("test");
Console.WriteLine("test");
}
[AllureStep("test")]
public void Test()
{
Console.WriteLine("test");
var throw = true;
if (throw) throw new Exception("test");
}
GOOD:
[AllureStep("test")]
public void Test(bool throw)
{
Console.WriteLine("test");
if (throw) throw new Exception("test");
Console.WriteLine("test");
}
[AllureStep("test")]
public string Test(bool throw)
{
Console.WriteLine("test");
if (throw) throw new Exception("test");
return "test";
}
There is no need to fix this at the moment. Just don't throw an exception for nothing.