picklesdoc / pickles

The open source living documentation generator
http://www.picklesdoc.com/
Apache License 2.0
464 stars 164 forks source link

Pickles did not complete successfully Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index') #615

Open PWithaarImproveQS opened 3 years ago

PWithaarImproveQS commented 3 years ago

The implementation of this function in VsTestElementExtensions.cs

internal static bool BelongsToScenario(this XElement xmlScenario, Scenario scenario)
{
    return xmlScenario.Name().ToUpperInvariant().StartsWith(TransformName(scenario.Name));
}

causes this error when we have scenario titles like this:


Scenario Outline: This is a great title 
(with 3 examples)

Scenario Outline: This is a great title and does also something more
(with 5 examples)

This is because the mapping to the test results is done on StartsWith. Causing the second one to map on the first one. The second scenario outline has 5 examples, but is mapped on the first one with 3 examples. Causing an index out of range exception. Pickles did not complete successfully Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')