示例#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);
        }
示例#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));
            }
        }
示例#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);
     }
 }
示例#4
0
 public ParameterConverter(ActionCatalog actionCatalog)
 {
     this.actionCatalog = actionCatalog;
 }
示例#5
0
 public StringStepRunner(ActionCatalog actionCatalog)
 {
     ActionCatalog      = actionCatalog;
     ParameterConverter = new ParameterConverter(ActionCatalog);
 }
示例#6
0
 public ActionStepParser(StoryRunnerFilter storyRunnerFilter, ActionCatalog actionCatalog)
 {
     this.storyRunnerFilter    = storyRunnerFilter;
     this.actionCatalog        = actionCatalog;
     methodWithAttributeFinder = new MethodWithAttributeFinder(storyRunnerFilter);
 }