Exemplo n.º 1
0
        public static SpecFlowFeature CreateFeature(string[] tags = null, string[] scenarioTags = null)
        {
            tags = tags ?? new string[0];

            var scenario1 = new Scenario(GetTags(scenarioTags), null, "Scenario", "scenario1 title", "", new Step[0]);

            return new SpecFlowFeature(GetTags(tags), null, "en", "feature", "title", "desc", null, new ScenarioDefinition[] {scenario1}, new Comment[0], null);
        }
Exemplo n.º 2
0
 internal G.Scenario CreateScenario(string[] tags, string name, string description, G.Step[] steps, G.Location location = null)
 {
     G.Scenario scenario = new G.Scenario(
         tags.Select(this.CreateTag).ToArray(),
         location ?? AnyLocation,
         "Scenario",
         name,
         description,
         steps);
     return(scenario);
 }
Exemplo n.º 3
0
		public void InvokeScenario (Scenario scenario, IEnumerable<MethodInfo> availableMethods)
		{

			foreach (var step in scenario.Steps) {
				_formatter.Log (step);

				MethodInfo stepMethod = GetStepMethod (step, availableMethods);
				// TODO steps should be global - create GetStepMethodDeclaringObject()
				if (stepMethod == null) {
					//					TODO notify the formatter of the step not having stepMethod
					continue;
				}
				var obj = Activator.CreateInstance(stepMethod.DeclaringType);
				stepMethod.Invoke (obj, null);
			}
		}
Exemplo n.º 4
0
        public Scenario MapToScenario(G.Scenario scenario)
        {
            if (scenario == null)
            {
                return(null);
            }

            return(new Scenario
            {
                Description = scenario.Description ?? string.Empty,
                Location = this.MapToLocation(scenario.Location),
                Name = scenario.Name,
                Slug = scenario.Name.ToSlug(),
                Steps = scenario.Steps.Select(this.MapToStep).ToList(),
                Tags = scenario.Tags.Select(this.MapToString).ToList()
            });
        }
Exemplo n.º 5
0
        public Scenario MapToScenario(G.Scenario scenario, params string[] tagsToHide)
        {
            if (scenario == null)
            {
                return(null);
            }

            var visibleTags = RetrieveOnlyVisibleTags(scenario.Tags, tagsToHide);

            return(new Scenario
            {
                Description = scenario.Description ?? string.Empty,
                Location = this.MapToLocation(scenario.Location),
                Name = scenario.Name,
                Slug = scenario.Name.ToSlug(),
                Steps = scenario.Steps.Select(this.MapToStep).ToList(),
                Tags = visibleTags
            });
        }
Exemplo n.º 6
0
        public ScenarioOutline MapToScenarioOutline(G.Scenario scenarioOutline, params string[] tagsToHide)
        {
            if (scenarioOutline == null)
            {
                return(null);
            }

            var visibleTags = RetrieveOnlyVisibleTags(scenarioOutline.Tags, tagsToHide);

            return(new ScenarioOutline
            {
                Description = scenarioOutline.Description ?? string.Empty,
                Examples = (scenarioOutline.Examples ?? new G.Examples[0]).Select(this.MapToExample).ToList(),
                Location = this.MapToLocation(scenarioOutline.Location),
                Name = scenarioOutline.Name,
                Slug = scenarioOutline.Name.ToSlug(),
                Steps = scenarioOutline.Steps.Select(this.MapToStep).ToList(),
                Tags = visibleTags
            });
        }
Exemplo n.º 7
0
 public Scenario MapToScenario(G.Scenario scenario)
 {
     return(this.mapper.Map <Scenario>(scenario));
 }
Exemplo n.º 8
0
 internal G.Scenario CreateScenario(string[] tags, string name, string description, G.Step[] steps, G.Location location = null)
 {
     G.Scenario scenario = new G.Scenario(
         tags.Select(this.CreateTag).ToArray(),
         location ?? AnyLocation,
         "Scenario",
         name,
         description,
         steps);
     return scenario;
 }
Exemplo n.º 9
0
		public void Log (Scenario scenario)
		{
			Console.WriteLine ("  Scenario: {0}", scenario.Name);
		}