private void Init() { NBehaveInitializer.Initialize(ConfigurationNoAppDomain.New.SetEventListener(Framework.EventListeners.EventListeners.NullEventListener())); actionCatalog = TinyIoCContainer.Current.Resolve<ActionCatalog>(); stringStepRunner = new StringStepRunner(actionCatalog); runner = new FeatureRunner(stringStepRunner, TinyIoCContainer.Current.Resolve<IRunContext>()); }
private void Init() { NBehaveInitializer.Initialize(ConfigurationNoAppDomain.New.SetEventListener(NBehave.EventListeners.EventListeners.NullEventListener())); actionCatalog = TinyIoCContainer.Current.Resolve <ActionCatalog>(); stringStepRunner = new StringStepRunner(actionCatalog); runner = new FeatureRunner(stringStepRunner, TinyIoCContainer.Current.Resolve <IRunContext>()); }
/// <summary> /// Method allowing to retrieve the <see cref="IBddRunner"/> instance from <see cref="IFeatureRunner"/>. /// The <see cref="IBddRunner"/> is a main runner interface that should be used for executing LightBDD scenarios, while the interfaces coming from LightBDD.Core namespace should be used only in integration projects. /// </summary> /// <param name="featureRunner">Instance of <see cref="IFeatureRunner"/>.</param> /// <param name="fixture">Feature fixture instance.</param> /// <returns></returns> public static IBddRunner GetBddRunner(this IFeatureRunner featureRunner, object fixture) { if (featureRunner == null) { throw new ArgumentNullException(nameof(featureRunner)); } return(new BddRunner(featureRunner.ForFixture(fixture).AsEnrichable())); }
public DefaultCommandLineRunner(IActionStepsFinder actionStepsFinder, IFeatureRunner featureRunner, IFeatureFileFinder featureFileFinder, IGherkinParser gherkinParser, IFileReader fileReader) { this.actionStepsFinder = actionStepsFinder; this.featureRunner = featureRunner; this.featureFileFinder = featureFileFinder; this.gherkinParser = gherkinParser; this.fileReader = fileReader; }
public DefaultCommandLineRunner(IActionStepsFinder actionStepsFinder, IFeatureRunner featureRunner, IFeatureFileFinder featureFileFinder, IGherkinParser gherkinParser, IFileReader fileReader) { this.actionStepsFinder = actionStepsFinder; this.featureRunner = featureRunner; this.featureFileFinder = featureFileFinder; this.gherkinParser = gherkinParser; this.fileReader = fileReader; }
public override void DoSetUp() { actionStepsFinder = Mock <IActionStepsFinder>(); featureRunner = Mock <IFeatureRunner>(); featureFileFinder = Mock <IFeatureFileFinder>(); gherkinParser = Mock <IGherkinParser>(); fileReader = Mock <IFileReader>(); sut = new DefaultCommandLineRunner(actionStepsFinder, featureRunner, featureFileFinder, gherkinParser, fileReader); }
public void SetUp() { _containerScope = new Mock <IDependencyContainerV2>(); _scenarioScope = new Mock <IDependencyContainerV2>(); _stepScope = new Mock <IDependencyContainerV2>(); _containerScope.Setup(x => x.BeginScope(It.IsAny <LifetimeScope>(), It.IsAny <Action <ContainerConfigurator> >())) .Returns(_scenarioScope.Object); _scenarioScope.Setup(x => x.BeginScope(It.IsAny <LifetimeScope>(), It.IsAny <Action <ContainerConfigurator> >())) .Returns(_stepScope.Object); _feature = new TestableFeatureRunnerRepository(TestableIntegrationContextBuilder.Default() .WithConfiguration(c => c.DependencyContainerConfiguration().UseContainer(_containerScope.Object))) .GetRunnerFor(GetType()); _runner = _feature.GetBddRunner(this); }
private FeatureResults Run(IFeatureRunner featureRunner, IEnumerable<Feature> features, IRunContext context) { var result = new FeatureResults(); foreach (Feature feature in features) { FeatureResult featureResult = null; try { context.FeatureStarted(feature); featureResult = featureRunner.Run(feature); result.Add(featureResult); } finally { context.FeatureFinished(featureResult); } } return result; }
private FeatureResults Run(IFeatureRunner featureRunner, IEnumerable <Feature> features, IRunContext context) { var result = new FeatureResults(); foreach (Feature feature in features) { FeatureResult featureResult = null; try { context.FeatureStarted(feature); featureResult = featureRunner.Run(feature); result.Add(featureResult); } finally { context.FeatureFinished(featureResult); } } return(result); }
public void SetUp() { _feature = TestableFeatureRunnerRepository.GetRunner(GetType()); _runner = _feature.GetBddRunner(this); }
public void SetUp() { _feature = TestableFeatureRunnerRepository.GetRunner(GetType()); _runner = _feature.GetBddRunner(this); _executedSteps = new List <string>(); }
/// <summary> /// Default constructor initializing <see cref="Runner"/> for feature class instance. /// </summary> protected FeatureFixture() { _featureRunner = FeatureRunnerProvider.GetRunnerFor(GetType()); Runner = _featureRunner.GetBddRunner(this); }