コード例 #1
0
        public void BackgroundBuilderBuildNoSteps()
        {
            var sut = new BackgroundBuilder(Internationalization.Default, string.Empty);

            sut.AddDescription("a description of the background");
            var result = sut.Build();

            result.Description.Should().Contain("a description of the background");
            result.Keyword.Syntax.Should().Be(GherkinKeyword.Background);
            result.Steps.Count().Should().Be(0);
        }
コード例 #2
0
        public void BackgroundBuilderWithOneStep()
        {
            var sut = new BackgroundBuilder(Internationalization.Default, string.Empty);

            sut.AddStep(this);
            var result = sut.Build();

            result.Steps.Count().Should().Be(1);
            var step = result.Steps.ElementAt(0);

            step.Parent.Should().Be(GherkinScenarioBlock.Given);
            step.Step.Syntax.Should().Be(GherkinStep.Given);
            step.Description.Should().Contain("the system is in this state");
        }
コード例 #3
0
 public void AddBackground(BackgroundBuilder backgroundBuilder)
 {
     this.background = backgroundBuilder;
 }
コード例 #4
0
        public void GherkinBlockShouldBe()
        {
            var sut = new BackgroundBuilder(Internationalization.Default, string.Empty);

            sut.Keyword.Syntax.Should().Be(GherkinKeyword.Background);
        }