public void DigestScenarioStepValues_Sets_DocString_Value()
        {
            //arrange.
            var featureInstance = new FeatureWithDocStringScenarioStep();
            var sut             = StepMethodInfo.FromMethodInfo(
                featureInstance.GetType().GetMethod(nameof(FeatureWithDocStringScenarioStep.Step_With_DocString_Argument)),
                featureInstance
                );

            var docStringContent = @"some content
+++
with multi lines
---
in it";

            var step = new Gherkin.Ast.Step(
                null,
                "Given",
                FeatureWithDocStringScenarioStep.StepWithDocStringText,
                new Gherkin.Ast.DocString(null, null, docStringContent));

            //act.
            sut.DigestScenarioStepValues(step);

            //assert.
            var digestedText = sut.GetDigestedStepText();

            Assert.Equal(FeatureWithDocStringScenarioStep.StepWithDocStringText, digestedText);
        }
Ejemplo n.º 2
0
        public void DigestScenarioStepValues_Sets_DocString_Value()
        {
            //arrange.
            var featureInstance = new FeatureWithDocStringScenarioStep();
            var sut             = StepMethodInfo.FromMethodInfo(
                featureInstance.GetType().GetMethod(nameof(FeatureWithDocStringScenarioStep.Step_With_DocString_Argument)),
                featureInstance
                );

            var scenarioName     = "scenario ajshas a";
            var docStringContent = @"some content
+++
with multi lines
---
in it";

            var step = CreateGherkinDocument(scenarioName,
                                             "Given " + FeatureWithDocStringScenarioStep.StepWithDocStringText + @"
" + @"""""""
" + docStringContent + @"
""""""").Feature.Children.First().Steps.First();

            //act.
            sut.DigestScenarioStepValues(step);

            //assert.
            var digestedText = sut.GetDigestedStepText();

            Assert.Equal(FeatureWithDocStringScenarioStep.StepWithDocStringText, digestedText);
        }
        public void FromMethodInfo_Creates_StepMethodInfo_With_DocString()
        {
            //arrange.
            var featureInstance = new FeatureWithDocStringScenarioStep();

            //act.
            var sut = StepMethodInfo.FromMethodInfo(
                featureInstance.GetType().GetMethod(nameof(FeatureWithDocStringScenarioStep.Step_With_DocString_Argument)),
                featureInstance
                );

            //assert.
            Assert.NotNull(sut);
        }