Esempio n. 1
0
        public FeatureResults Run()
        {
            NBehaveInitializer.Initialize(configuration);
            actionCatalog = TinyIoCContainer.Current.Resolve <ActionCatalog>();
            var featureRunner = TinyIoCContainer.Current.Resolve <IFeatureRunner>();
            var context       = TinyIoCContainer.Current.Resolve <IRunContext>();
            var results       = new FeatureResults();

            try
            {
                context.RunStarted();
                LoadAssemblies();
                var loader   = new LoadScenarioFiles(configuration);
                var files    = loader.LoadFiles();
                var parse    = new ParseScenarioFiles(configuration);
                var features = parse.LoadFiles(files);
                results = Run(featureRunner, features, context);
            }
            finally
            {
                context.RunFinished(results);
            }

            return(results);
        }
Esempio n. 2
0
        private void RunStep(StringStep actionStep)
        {
            var info = ActionCatalog.GetAction(actionStep);

            if (actionStep is StringTableStep && !ShouldForEachOverStep(info))
            {
                ForEachOverStep(actionStep as StringTableStep, info);
            }
            else
            {
                RunStep(info, () => ParameterConverter.GetParametersForStep(actionStep));
            }
        }
Esempio n. 3
0
 public void Run(StringStep step)
 {
     try
     {
         if (!ActionCatalog.ActionExists(step))
         {
             var pendReason = string.Format("No matching Action found for \"{0}\"", step);
             step.PendNotImplemented(pendReason);
         }
         else
         {
             RunStep(step);
         }
     }
     catch (Exception e)
     {
         var realException = FindUsefulException(e);
         step.Fail(realException);
     }
 }
Esempio n. 4
0
 public ParameterConverter(ActionCatalog actionCatalog)
 {
     this.actionCatalog = actionCatalog;
 }
Esempio n. 5
0
 public StringStepRunner(ActionCatalog actionCatalog)
 {
     ActionCatalog      = actionCatalog;
     ParameterConverter = new ParameterConverter(ActionCatalog);
 }
Esempio n. 6
0
 public ActionStepParser(StoryRunnerFilter storyRunnerFilter, ActionCatalog actionCatalog)
 {
     this.storyRunnerFilter    = storyRunnerFilter;
     this.actionCatalog        = actionCatalog;
     methodWithAttributeFinder = new MethodWithAttributeFinder(storyRunnerFilter);
 }