A step expression can capture a value as one type while its method accepts another. When Reqnroll invokes the step definition, it compares those types and attempts a built-in conversion. section 14.4
Built-in conversions support:
- Basic types such as int, decimal, and DateTime. section 14.4
- Enums, matched without regard to case, and GUIDs. section 14.4
Pizza size as an enum
A step can capture the quoted value "Large" with {string} and pass it to a method parameter of type PizzaSize. Alternatively, use {PizzaSize} in the expression and write large without quotes. If scenarios use inch measurements instead of enum values, built-in enum conversion no longer fits; convert the value manually or define a custom parameter type. section 14.4
