public static IEnumerable<Step> GetSteps(ScenarioToBeScannedUsingFluentScanner testObject) { var fluentScanner = TestContext.GetContext(testObject .Given(s => s.GivenSomeState(1, 2)) .And(s => s.WhenSomeStepUsesIncompatibleNamingConvention()) .And(s => s.AndAMethodTakesArrayInputs(new[] {"1", "2"}, new[] {3, 4}, 5)) .And(s => s.AndSomeStateWithIncorrectAttribute()) .When(s => s.WhenSomethingHappens("some input here")) .And(s => s.AndThenSomethingElseHappens(), "Overriding step name without arguments") .And(s => s.WhenSomethingHappens("other input"), "step used with {0} for the second time") .And(s => s.WhenSomethingHappens("other input"), false) .Then(s => s.ThenTheFollowingAssertionsShouldBeCorrect()) .And(s => s.AndIncorrectAttributeWouldNotMatter()) .And(s => s.ThenTitleFormatingWorksToo(InputDate), InputDateStepTitleTemplate) .TearDownWith(s => s.Dispose())).FluentScanner; return fluentScanner.GetScanner(null, null).Scan().Scenarios.SelectMany(s => s.Steps).ToList(); }
public static IEnumerable <Step> GetSteps(ScenarioToBeScannedUsingFluentScanner testObject) { var fluentScanner = TestContext.GetContext(testObject .Given(s => s.GivenSomeState(1, 2)) .And(s => s.WhenSomeStepUsesIncompatibleNamingConvention()) .And(s => s.AndAMethodTakesArrayInputs(new[] { "1", "2" }, new[] { 3, 4 }, 5)) .And(s => s.AndSomeStateWithIncorrectAttribute()) .When(s => s.WhenSomethingHappens("some input here")) .And(s => s.AndThenSomethingElseHappens(), "Overriding step name without arguments") .And(s => s.WhenSomethingHappens("other input"), "step used with {0} for the second time") .And(s => s.WhenSomethingHappens("other input"), false) .Then(s => s.ThenTheFollowingAssertionsShouldBeCorrect()) .And(s => s.AndIncorrectAttributeWouldNotMatter()) .And(s => s.ThenTitleFormatingWorksToo(InputDate), InputDateStepTitleTemplate) .TearDownWith(s => s.Dispose())).FluentScanner; return(fluentScanner.GetScanner(null, null).Scan().Scenarios.SelectMany(s => s.Steps).ToList()); }
public void Setup() { var scenario = new ScenarioToBeScannedUsingFluentScanner(); _steps = ScenarioToBeScannedUsingFluentScanner.GetSteps(scenario); }
public WhenStepsAreScannedUsingFluentScanner() { var scenario = new ScenarioToBeScannedUsingFluentScanner(); _steps = ScenarioToBeScannedUsingFluentScanner.GetSteps(scenario); }