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

DataTable and DocString in Scenario Outline - don't inject examples by default #148

Open
ttutisani opened this issue Mar 11, 2024 · 0 comments

Comments

@ttutisani
Copy link
Owner

This is a tech debt.

By default, example values are injected into DocString and DataTable. This makes it impossible to have these arguments with values that look like placeholders but are not. e.g., a DocString containing <a> will always receive an example value from a column named "a".

This issue - #145 - explains one of the possible implementations for supporting both kinds of arguments, in one of my comments. Specifically (everything below is a quote from the issue):

=================================

So, the right way would be to have difference between a DocString that does not ingest example values (that will be a default behavior), and a DocString that ingests parameter values. I see two options for that.

Option 1: I think this can be simpler - to add an annotation to DocString indicating it's not a default behavior.

[When(@"code block is sent")]
public void CodeBlockIsSent([IngectExampleValues] DocString codeBlock)
{
    System.Console.WriteLine(codeBlock.Content);
}

Option 2: this will be more work and only do this if the first option is impossible - introduce a new argument type to indicate it's not a default behavior.

[When(@"code block is sent")]
public void CodeBlockIsSent(DocStringFromExample codeBlock)
{
    System.Console.WriteLine(codeBlock.Content);
}

Apply the same fix for DataTable.

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

No branches or pull requests

1 participant