private void AddStep(ScenarioBuilder scenarioBuilder, StepType stepType, Step step, StringBuilder input, StringBuilder explanation) { if (input.Length > 0) { step.Input = input.ToString(); input.Clear(); step.InputFormat = TextFormat.text; } if (explanation.Length > 0) { step.Explanation = explanation.ToString(); explanation.Clear(); } switch (stepType) { case StepType.Given: scenarioBuilder.Given(step); break; case StepType.When: scenarioBuilder.When(step); break; case StepType.Then: scenarioBuilder.Then(step); break; case StepType.And: scenarioBuilder.And(step); break; case StepType.Code: scenarioBuilder.Code(step); break; } }