Skip to content

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

@Raatiw

Description

@Raatiw

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')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions