private void CaptureAndStoreRemainingElements() { if (this.isInExample && this.exampleBuilder != null) { this.scenarioOutlineBuilder.AddExample(this.exampleBuilder.GetResult()); this.exampleBuilder = null; } if (this.featureElementState.IsBackgroundActive) { this.backgroundBuilder.AddStep(this.stepBuilder.GetResult()); this.theFeature.AddBackground(this.backgroundBuilder.GetResult()); } else if (this.featureElementState.IsScenarioActive) { if (this.stepBuilder != null) { this.scenarioBuilder.AddStep(this.stepBuilder.GetResult()); } this.theFeature.AddFeatureElement(this.scenarioBuilder.GetResult()); } else if (this.featureElementState.IsScenarioOutlineActive) { if (this.stepBuilder != null) { this.scenarioOutlineBuilder.AddStep(this.stepBuilder.GetResult()); } this.theFeature.AddFeatureElement(this.scenarioOutlineBuilder.GetResult()); } this.stepBuilder = null; this.scenarioBuilder = null; this.scenarioOutlineBuilder = null; this.backgroundBuilder = null; }
public void background(string keyword, string name, string description, int line) { this.isInExample = false; this.featureElementState.SetBackgroundActive(); this.backgroundBuilder = new ScenarioBuilder(); this.backgroundBuilder.SetName(name); this.backgroundBuilder.SetDescription(description); }
public void scenario(string keyword, string name, string description, int line) { this.CaptureAndStoreRemainingElements(); this.isInExample = false; this.featureElementState.SetScenarioActive(); this.scenarioBuilder = new ScenarioBuilder(); this.scenarioBuilder.SetName(name); this.scenarioBuilder.SetDescription(description); this.scenarioBuilder.AddTags(this.scenarioTags); this.scenarioTags.Clear(); }
private void CaptureAndStoreRemainingElements() { if (this.isInExample && this.exampleBuilder != null) { this.scenarioOutlineBuilder.AddExample(this.exampleBuilder.GetResult()); this.exampleBuilder = null; } if (this.featureElementState.IsBackgroundActive) { this.backgroundBuilder.AddStep(this.stepBuilder.GetResult()); this.theFeature.AddBackground(this.backgroundBuilder.GetResult()); } else if (this.featureElementState.IsScenarioActive) { if (this.stepBuilder != null) this.scenarioBuilder.AddStep(this.stepBuilder.GetResult()); this.theFeature.AddFeatureElement(this.scenarioBuilder.GetResult()); } else if (this.featureElementState.IsScenarioOutlineActive) { if (this.stepBuilder != null) this.scenarioOutlineBuilder.AddStep(this.stepBuilder.GetResult()); this.theFeature.AddFeatureElement(this.scenarioOutlineBuilder.GetResult()); } this.stepBuilder = null; this.scenarioBuilder = null; this.scenarioOutlineBuilder = null; this.backgroundBuilder = null; }