Reqnroll icon indicating copy to clipboard operation
Reqnroll copied to clipboard

Regex evaluation with StepArgumentTransformation creates undesired behaviour.

Open BasHamer opened this issue 6 months ago • 1 comments

Reqnroll Version

2.4.1

Which test runner are you using?

MSTest

Test Runner Version Number

3.9.3

.NET Implementation

.NET 9.0

Test Execution Method

Visual Studio Test Explorer

Content of reqnroll.json configuration file

no json is used

Issue Description

this works

[Given(@"the Test Object")]
[Given(@"the Test Objects")]
public void GivenThetestObjects(Dictionary<string, TestObject> testObjects)

this is not detected

[Given(@"the Test Objects?")]
public void GivenThetestObjects(Dictionary<string, TestObject> testObjects)

and this work again

[Given(@"the Test Objects?$")]
public void GivenThetestObjects(Dictionary<string, TestObject> testObjects)

this is the transformation; changing to DataTable does not help.

 [StepArgumentTransformation]
 public Dictionary<string, T> TransformDictionary(Table table)

Steps to Reproduce

https://github.com/Possum-Labs/DSL/commit/fe496cd07b539080ef6b4df4c6c91fabf77946e8

Link to Repro Project

https://github.com/Possum-Labs/DSL/

BasHamer avatar Jul 15 '25 12:07 BasHamer

This issue could be resolved with the idea in #663

304NotModified avatar Jul 29 '25 23:07 304NotModified

With Reqnroll 3 you could fix this with the ExpressionType parameter, see https://docs.reqnroll.net/latest/automation/cucumber-expressions.html#explicit-expression-type-control

So closing this as fixed :)

304NotModified avatar Dec 19 '25 04:12 304NotModified