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

Update rules for step definitions methods #2576

Merged
merged 1 commit into from
Mar 25, 2022
Merged

Update rules for step definitions methods #2576

merged 1 commit into from
Mar 25, 2022

Conversation

SamJ26
Copy link
Contributor

@SamJ26 SamJ26 commented Mar 25, 2022

The Step Definition Methods Rules section states that "method can not have a return type or have a Task as return type". I tried to change my method to return int instead of void and it works without errors. So I guess if it's not a rule which would cause an error than it should be rather recommendation than rule.

If it's a bug that SpecFlow should catch, I can provide you steps to reproduce it (although it's a very simple 😀)

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Performance improvement
  • Refactoring (so no functional change)
  • Other (docs, build config, etc)

Checklist:

  • I've added tests for my code. (most of the time mandatory)
  • I have added an entry to the changelog. (mandatory)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

The Step Definition Methods Rules section states that "method can not have a return type or have a `Task` as return type". I tried to change my method to return `int` instead of `void` and it works without errors. So I guess if it's not a rule which would cause an error than it should be rather recommendation than rule.
@SamJ26 SamJ26 changed the title Update rules for step definitions method Update rules for step definitions methods Mar 25, 2022
@SabotageAndi
Copy link
Contributor

Yeah, we don't enforce this rule. If it is not a Task, we simply ignore the return type.

Thanks for your contribution to SpecFlow.
Please submit your contributions to our SpecFlow Community Heroes program at https://specflow.org/community/submit-a-contribution/

@SabotageAndi SabotageAndi merged commit ba1aae2 into SpecFlowOSS:master Mar 25, 2022
Code-Grump pushed a commit to Code-Grump/SpecFlow that referenced this pull request Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants