public void DigestScenarioStepValues_Throws_Error_If_Arguments_Present_But_No_DocString()
        {
            //arrange.
            var sut = new DocStringArgument();

            //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 DocStringArgument();
            var docStringContent = @"some content
+++
with multi lines
---
in it";
            var docString        = new Gherkin.Ast.DocString(null, null, docStringContent);

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

            //assert.
            Assert.Same(docString, sut.Value);
        }
        public void DigestScenarioStepValues_Sets_Value_As_DocString_When_Only_DocString()
        {
            //arrange.
            var sut = new DocStringArgument();
            var docStringContent = @"some content
+++
with multi lines
---
in it";
            var docString        = new Gherkin.Ast.DocString(null, null, docStringContent);

            //act.
            sut.DigestScenarioStepValues(new string[0], docString);

            //assert.
            Assert.Same(docString, sut.Value);
        }
示例#4
0
        public void DigestScenarioStepValues_Sets_Value_As_DataTable_When_DataTable_And_Other_Args_Present()
        {
            //arrange.
            var sut              = new DocStringArgument();
            var scenarioName     = "scenario-121kh2";
            var docStringContent = @"some content
+++
with multi lines
---
in it";
            var docString        = CreateGherkinDocument(scenarioName,
                                                         @"Given some step text
" + @"""""""
" + docStringContent + @"
""""""").Feature.Children.ElementAt(0).Steps.ElementAt(0).Argument as Gherkin.Ast.DocString;

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

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