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

Fix step definition attribute support for the Visual Studio Extension #2065

Merged
merged 3 commits into from
Jul 23, 2020

Conversation

tzongithub
Copy link
Contributor

@tzongithub tzongithub commented Jul 22, 2020

The generalization and simplifications of the handling of step definition attributes in #1938 break the analysis of the bindings in the Visual Studio Extension. In the Visual Studio Extension the step definition attributes are analyzed from the source code of the binding classes. Hence the binding reflection is not based on compiled/runtime types.

The TechTalk.SpecFlow.Bindings.Reflection.IBindingType instances returned by the Visual Studio Extension are not RuntimeBindingTypes and do not implement the IPolymorphicBindingType interface. As long as the extension works with source code constructs in the binding analysis this has to be taken into account.

The usage of the extension method BindingReflectionExtensions.IsAssignableFrom can be especially misleading, because it looks very similar to a System.Type.IsAssignableFrom call, but the semantics are not the same. Especially if the IBindingType is not an IPolymorphicBindingType, because then the extension method only compares the FullName of the types without being able to take polymorphism/inheritance into account.

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.

@tzongithub tzongithub marked this pull request as ready for review July 22, 2020 15:30
Copy link
Contributor

@SabotageAndi SabotageAndi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the coding looks good for me. If all tests are still green and it solves your issue, you can merge it.

@tzongithub tzongithub merged commit 2324c4b into master Jul 23, 2020
@tzongithub tzongithub deleted the vs-stepdefinitionattributes branch July 23, 2020 10:13
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.

None yet

2 participants