Skip to content

Only the table of the examples in a scenario outline should have test results#515

Merged
dirkrombauts merged 7 commits intopicklesdoc:developfrom
spacehole1:develop
Apr 19, 2018
Merged

Only the table of the examples in a scenario outline should have test results#515
dirkrombauts merged 7 commits intopicklesdoc:developfrom
spacehole1:develop

Conversation

@spacehole1
Copy link
Copy Markdown

Hello,

To fix #514 I created an ExampleTable which have TestDataRows in the Example Object.

Only this kind of Table is expected to have Json containing results.

Today you have:
image

After you will get back to having
image

No change on Scenraio Ouline results
Hope I didn't miss any thing, all tests are ok.

Regards,

Copy link
Copy Markdown
Member

@dirkrombauts dirkrombauts left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution. I have some ideas on how to improve the code, please take a look at them.

actualResult = Regex.Replace(actualResult, @"\s+", string.Empty);
expectedResult = Regex.Replace(expectedResult, @"\s+", string.Empty);

Debug.Print(actualResult);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't like debug statements left after the debug session :-)

// --------------------------------------------------------------------------------------------------------------------

using System;
using System.Diagnostics;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We won't need this one anymore after you remove the Debug statement

AddRange(cells);
this.Result = result;
Add(result);
if (result != null)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we need a null check?


}

public class TestTableRow : TableRow
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

TestTableRow sounds like it's a table for testing purposes. I prefer a name like "TableRowWithTestResult" or something like that.

}

public TableRow MapToTableRow(G.TableRow tableRow)
public TableRow MapToTableRow(G.TableRow tableRow, bool isForExample=false)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The isForExample parameter is a code smell to me. You're steering the behavior of the class depending on this parameter. Is would prefer having a method MapToTableRow and another one MapToTableRowWithTestData and let the caller of the method decide which variant to use. The caller already makes that decision when they determine the value for isForExample, there is no need to make the same decision twice.

@spacehole1
Copy link
Copy Markdown
Author

you are entirely right, i'm fixing and repushing. I was a bit lazy on this one
Thanks for the review

@Greybird
Copy link
Copy Markdown

Hi,

Sorry to ask, but is there any progress on this issue ?

Regards,

@dirkrombauts
Copy link
Copy Markdown
Member

I have scheduled some Pickles time today, I hope I'll be able to work through most of the pull requests.

@dirkrombauts dirkrombauts merged commit e170a57 into picklesdoc:develop Apr 19, 2018
@dirkrombauts dirkrombauts changed the title Only Example have TableData with results Only the table of the examples in a scenario outline should have test results Apr 20, 2018
@dirkrombauts dirkrombauts mentioned this pull request Apr 20, 2018
@dirkrombauts
Copy link
Copy Markdown
Member

Released in version 2.18.1.

@Greybird
Copy link
Copy Markdown

Thanks!

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.

Scenario using Table shouldn't have inconclusive result

3 participants