Example #1
0
 public Feature(string title, string source)
 {
     Source = source;
     Scenarios = new List<Scenario>();
     ExtractTitleAndNarrative(title);
     Background = new Scenario(String.Empty, string.Empty, this);
 }
Example #2
0
 public Feature(string title, string narrative, string source, int sourceLine)
 {
     Source = source;
     Scenarios = new List<Scenario>();
     Title = title;
     Narrative = narrative;
     SourceLine = sourceLine;
     Background = new Scenario(String.Empty, string.Empty, this, -1);
 }
Example #3
0
 private void BuildScenario(Scenario scenario)
 {
     var parent = _parent;
     _parent = new NBehaveScenarioTestElement(scenario.Title, _parent.FeatureFile, _unitTestProvider, _projectModel, _parent);
     Add(_parent);
     BuildBackgroundElements(scenario);
     BuildSteps(scenario.Steps);
     BuildExamples(scenario);
     _parent = parent;
 }
Example #4
0
 private void BuildBackgroundElements(Scenario scenario)
 {
     var feature = scenario.Feature;
     if (feature.Background.Steps.Any() == false)
         return;
     var origParent = _parent;
     _parent = new NBehaveBackgroundTestElement(_parent.ShortName, _parent.FeatureFile, _unitTestProvider, _projectModel, _parent);
     Add(_parent);
     BuildSteps(feature.Background.Steps);
     _parent = origParent;
 }
Example #5
0
 private void BuildExamples(Scenario scenario)
 {
     if (scenario.Examples.Any() == false)
         return;
     var ex = new NBehaveExampleParentTestElement(scenario.Examples, _parent.FeatureFile, _unitTestProvider, _projectModel, _parent);
     Add(ex);
     foreach (var example in scenario.Examples)
     {
         var s = new NBehaveExampleTestElement(example, _parent.FeatureFile, _unitTestProvider, _projectModel, ex);
         Add(s);
     }
 }
Example #6
0
 public ScenarioGherkinText(Scenario scenario)
 {
     this.scenario = scenario;
 }
Example #7
0
 public void AddScenario(Scenario scenario)
 {
     scenario.Feature = this;
     Scenarios.Add(scenario);
 }
Example #8
0
 public void AddBackground(Scenario scenario)
 {
     Background = scenario;
 }
Example #9
0
 public ScenarioContext(FeatureContext featureContext, Scenario scenario, IEnumerable<string> tags)
     : this(featureContext, scenario)
 {
     AddTags(tags);
 }
Example #10
0
 public ScenarioContext(FeatureContext featureContext, Scenario scenario)
 {
     FeatureContext = featureContext;
     Scenario = scenario;
 }