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

NUnit: IndexOutOfRangeException if AllureAfter is applied on a method with paramters #419

Closed
1 of 3 tasks
delatrie opened this issue Nov 13, 2023 · 0 comments · Fixed by #460
Closed
1 of 3 tasks

Comments

@delatrie
Copy link
Contributor

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

If a method with AllureAfter and at least one parameter is called, IndexOutOfRangeException is thrown.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

The following code throws an unexpected IndexOutOfRangeException:

using NUnit.Allure.Attributes;
using NUnit.Allure.Core;
using NUnit.Framework;

[AllureNUnit]
class MyTestFixture
{
    [AllureAfter]
    public void CustomTearDown(int a) { }

    [Test]
    public void MyTest()
    {
        this.CustomTearDown(1);
    }
}

What is the expected behavior?

No exception is thrown, the fixture is added to the report.

What is the motivation / use case for changing the behavior?

To support custom tear down methods.

Please tell us about your environment:

Other information

This is due to invalid call at

return target(Array.Empty<object>());

delatrie added a commit that referenced this issue Mar 26, 2024
  - missing container if [AllureAfter] is applied to some, but not all
    OneTimeTearDown methods of a class
  - Fix IndexOutOfRangeException if [AllureAfter] is applied to a method
    with arguments
delatrie added a commit that referenced this issue Mar 26, 2024
  - missing container if [AllureAfter] is applied to some, but not all
    OneTimeTearDown methods of a class
  - Fix IndexOutOfRangeException if [AllureAfter] is applied to a method
    with arguments
delatrie added a commit that referenced this issue Mar 27, 2024
  - missing container if [AllureAfter] is applied to some, but not all
    OneTimeTearDown methods of a class
  - Fix IndexOutOfRangeException if [AllureAfter] is applied to a method
    with arguments
delatrie added a commit that referenced this issue Mar 27, 2024
  - missing container if [AllureAfter] is applied to some, but not all
    OneTimeTearDown methods of a class
  - Fix IndexOutOfRangeException if [AllureAfter] is applied to a method
    with arguments
delatrie added a commit that referenced this issue Mar 27, 2024
  - missing container if [AllureAfter] is applied to some, but not all
    OneTimeTearDown methods of a class
  - Fix IndexOutOfRangeException if [AllureAfter] is applied to a method
    with arguments
delatrie added a commit that referenced this issue Mar 28, 2024
  - missing container if [AllureAfter] is applied to some, but not all
    OneTimeTearDown methods of a class
  - Fix IndexOutOfRangeException if [AllureAfter] is applied to a method
    with arguments
delatrie added a commit that referenced this issue Mar 28, 2024
  - missing container if [AllureAfter] is applied to some, but not all
    OneTimeTearDown methods of a class
  - Fix IndexOutOfRangeException if [AllureAfter] is applied to a method
    with arguments
delatrie added a commit that referenced this issue Mar 28, 2024
  - missing container if [AllureAfter] is applied to some, but not all
    OneTimeTearDown methods of a class
  - Fix IndexOutOfRangeException if [AllureAfter] is applied to a method
    with arguments
delatrie added a commit that referenced this issue Mar 28, 2024
* Improve Allure NUnit status reporting

  - New algorithm to distinguish between failed/broken tests. Now, a test
    is failed if NUnit shows at least one failed assertion and no
    assertion errors. The 'brokenTestData' config property is removed.
  - Remove empty status details for passed tests (#363)

* Remove empty console log attachments from tests (#363)

Additional changes:
  - Remove redundant config from Allure.NUnit project
  - Fix conflicting IgnoreTestWithTestCaseData test names in
    Allure.NUnit.Examples

* Fix NUnit OneTimeTearDown reporting (#419)

  - missing container if [AllureAfter] is applied to some, but not all
    OneTimeTearDown methods of a class
  - Fix IndexOutOfRangeException if [AllureAfter] is applied to a method
    with arguments

* Use the common skip reason for test plans

* Preclude ignored tests not in a test plan from report

* Remove ignored test containers

Every ignored test container contains no fixtures.

* Fix labeler entry for Allure NUnit examples

* Change Allure NUnit namespace to Allure.NUnit

Backward compatibility is implemented via OldNamespaceCompatibility

* Remove deprecated API from Allure.NUnit:

  - AllureNUnitHelper:
      - WrapInStep
      - SaveOneTimeResultToContext
      - AddOneTimeSetupResult
  - StepsHelper

* Hide internal API
@delatrie delatrie linked a pull request Apr 1, 2024 that will close this issue
@delatrie delatrie closed this as completed Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant