SpecFlow
SpecFlow copied to clipboard
Added order parameter to stepArgumentTransformation to prioritize execution
What's changed
- Added an optional
Orderparameter forStepArgumentTransformationto prioritize global type handlers effectively, ensuring they're considered last when needed. - Renamed
StepTransformationTestsfile toStepArgumentTransformationTestsas this change should've be done with this commit
In .NET 6 and earlier versions, the GetMethods method does not return methods in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which methods are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly.
Type.GetMethods is used to find all StepArgumentTransformation functions, but the order is not deterministic before .NET 7. This inconsistency made it tricky to handle type transformations, especially when setting up global handlers for optional parameters.
Types of changes
- [x] New feature (non-breaking change which adds functionality).
- [x] Other (docs, build config, etc)
Checklist:
- [x] I've added tests for my code. (most of the time mandatory)
- [x] I have added an entry to the changelog. (mandatory)
- [x] My change requires a change to the documentation.
- [x] I have updated the documentation accordingly.