Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since 3.1.1-beta1 throw new exception in code in method with AllureStep stops discovering steps at all #47

Open
Noksa opened this issue May 20, 2020 · 1 comment
Assignees
Labels
bug Something isn't working nunit-allure

Comments

@Noksa
Copy link
Owner

Noksa commented May 20, 2020

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
@Noksa Noksa self-assigned this May 20, 2020
@Noksa Noksa added bug Something isn't working nunit-allure labels May 20, 2020
@Noksa
Copy link
Owner Author

Noksa commented May 20, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working nunit-allure
Projects
None yet
Development

No branches or pull requests

1 participant