public ScenarioOutlineExampleRowViewModel(ScenarioOutlineViewModel scenario, GherkinTableRow header, GherkinTableRow row) { DataRowNode = row; PlaceholderValues = header.Cells.Zip(row.Cells, Tuple.Create).ToDictionary(x => x.Item1.Value, x => x.Item2.Value); Steps = scenario.StepTemplates.Select(BuildStep).ToList(); }
public ScenarioOutlineExampleSetViewModel(ScenarioOutlineViewModel scenario, ExampleSet exampleSet) { ExampleSetNode = exampleSet; var table = exampleSet.Table; ExampleRows = table.Body.Select(x => new ScenarioOutlineExampleRowViewModel(scenario, table.Header, x)).ToList(); PlaceholderAffectedSteps = PlaceholderNames.ToDictionary(x => x, x => ExampleRows .SelectMany((er, index) => scenario.StepTemplates.Zip(er.Steps, (stepTemplate, step) => new { index, stepTemplate, step })) .Where(a => a.stepTemplate.PlaceHolderNames.Contains(x)) .ToLookup(a => a.index, a => a.step) .ToDictionary(g=>g.Key, g=>g.ToList())); }
public ScenarioOutlineTest() : base(@"Feature: ScenarioTables In order to avoid silly mistakes As a math idiot I want to be told the sum of two numbers Scenario Outline: Scenario outlines - eating Given there are <start> cucumbers When I eat <eat> cucumbers Then <left> cucumbers should be left Examples: | start | eat | left | | 12 | 5 | 7 | | 20 | 5 | 15 |") { _firstScenario = _viewModel.RootFolder.Features.First().Scenarios.First() as ScenarioOutlineViewModel; }