/// <summary>
        /// Initializes runner for given feature test class type with given progress notifier.
        /// Given featureTestClass type Name is used as feature name.
        /// If test class is annotated with [FeatureDescription] attribute or implementation specific description attribute, it's content is used as feature description.
        /// </summary>
        /// <param name="featureTestClass">Test class type.</param>
        /// <param name="progressNotifier">Progress notifier.</param>
        /// <param name="metadataProvider">Test metadata provider.</param>
        protected AbstractBDDRunner(Type featureTestClass, TestMetadataProvider metadataProvider, IProgressNotifier progressNotifier)
        {
            if (featureTestClass == null)
            {
                throw new ArgumentNullException("featureTestClass");
            }
            if (metadataProvider == null)
            {
                throw new ArgumentNullException("metadataProvider");
            }
            if (progressNotifier == null)
            {
                throw new ArgumentNullException("progressNotifier");
            }

            _metadataProvider = metadataProvider;
            ProgressNotifier  = progressNotifier;
            _stepsConverter   = new StepsConverter(_metadataProvider, MapExceptionToStatus);
            _result           = new FeatureResult(
                _metadataProvider.GetFeatureName(featureTestClass),
                _metadataProvider.GetFeatureDescription(featureTestClass),
                _metadataProvider.GetFeatureLabel(featureTestClass));
            _executor = new ScenarioExecutor(ProgressNotifier);
            _executor.ScenarioExecuted += _result.AddScenario;
            ProgressNotifier.NotifyFeatureStart(_result.Name, _result.Description, _result.Label);
        }
Example #2
0
        /// <summary>
        /// Initializes runner for given feature test class type with given progress notifier.
        /// Given featureTestClass type Name is used as feature name.
        /// If test class is annotated with [FeatureDescription] attribute or implementation specific description attribute, it's content is used as feature description.
        /// </summary>
        /// <param name="featureTestClass">Test class type.</param>
        /// <param name="progressNotifier">Progress notifier.</param>
        /// <param name="metadataProvider">Test metadata provider.</param>
        protected AbstractBDDRunner(Type featureTestClass, TestMetadataProvider metadataProvider, IProgressNotifier progressNotifier)
        {
            _metadataProvider = metadataProvider;
            ProgressNotifier  = progressNotifier;

            _result = new FeatureResult(_metadataProvider.GetFeatureName(featureTestClass), _metadataProvider.GetFeatureDescription(featureTestClass), _metadataProvider.GetFeatureLabel(featureTestClass));
            ProgressNotifier.NotifyFeatureStart(_result.Name, _result.Description, _result.Label);
        }