public void DigestScenarioStepValues_Sets_Value_As_DataTable_When_DataTable_And_Other_Args_Present()
        {
            //arrange.
            var sut       = new DataTableArgument();
            var dataTable = new Gherkin.Ast.DataTable(new Gherkin.Ast.TableRow[]
            {
                new Gherkin.Ast.TableRow(null, new Gherkin.Ast.TableCell[]
                {
                    new Gherkin.Ast.TableCell(null, "First argument"),
                    new Gherkin.Ast.TableCell(null, "Second argument"),
                    new Gherkin.Ast.TableCell(null, "Result"),
                }),
                new Gherkin.Ast.TableRow(null, new Gherkin.Ast.TableCell[]
                {
                    new Gherkin.Ast.TableCell(null, "1"),
                    new Gherkin.Ast.TableCell(null, "2"),
                    new Gherkin.Ast.TableCell(null, "3"),
                }),
                new Gherkin.Ast.TableRow(null, new Gherkin.Ast.TableCell[]
                {
                    new Gherkin.Ast.TableCell(null, "a"),
                    new Gherkin.Ast.TableCell(null, "b"),
                    new Gherkin.Ast.TableCell(null, "c"),
                })
            });

            //act.
            sut.DigestScenarioStepValues(new string[] { "1", "2", "3" }, dataTable);

            //assert.
            Assert.Same(dataTable, sut.Value);
        }
        public void DigestScenarioStepValues_Throws_Error_If_Arguments_Present_But_No_DataTable()
        {
            //arrange.
            var sut = new DataTableArgument();

            //act / assert.
            Assert.Throws <InvalidOperationException>(() => sut.DigestScenarioStepValues(new string[] { "1", "2", "3" }, null));
        }
        public void DigestScenarioStepValues_Sets_Value_As_DataTable_When_DataTable_And_Other_Args_Present()
        {
            //arrange.
            var sut       = new DataTableArgument();
            var dataTable = CreateGherkinDocument("scenario123",
                                                  "When some step text" + Environment.NewLine +
                                                  @"  | First argument | Second argument | Result |
    | 1              |       2         |       3|
    | a              |   b             | c      |
"
                                                  ).Feature.Children.ElementAt(0).Steps.ElementAt(0).Argument as Gherkin.Ast.DataTable;

            //act.
            sut.DigestScenarioStepValues(new string[] { "1", "2", "3" }, dataTable);

            //assert.
            Assert.Same(dataTable, sut.Value);
        }