Exemplo n.º 1
0
        /// <summary>
        /// Default constructor, using "lightbdd" config section to initialize <c>PredefinedStepTypes</c> and <c>RepeatedStepReplacement</c> property values.
        ///
        /// The following code presents how <c>PredefinedStepTypes</c> and <c>RepeatedStepReplacement</c> can be configured:
        /// <code>
        /// &lt;?xml version="1.0" encoding="utf-8" ?&gt;
        ///&lt;configuration&gt;
        ///  &lt;configSections&gt;
        ///    &lt;section name="lightbdd" type="LightBDD.Configuration.LightBDDConfiguration, LightBDD"/&gt;
        ///  &lt;/configSections&gt;
        ///  &lt;lightbdd&gt;
        ///    &lt;stepTypes predefined="given,when,then,setup,and" repeatedStepReplacement="and"/&gt;
        ///  &lt;/lightbdd&gt;
        ///&lt;/configuration&gt;
        /// </code>
        /// </summary>
        protected TestMetadataProvider()
        {
            var stepTypes = LightBDDConfiguration.GetConfiguration().StepTypes;

            PredefinedStepTypes     = stepTypes.Predefined.Split(',').Select(t => t.Trim()).ToArray();
            RepeatedStepReplacement = stepTypes.RepeatedStepReplacement.Trim();
        }
        public static SummaryGenerator Create()
        {
            var cfg = LightBDDConfiguration.GetConfiguration();

            return(new SummaryGenerator(cfg.SummaryWriters.OfType <SummaryWriterElement>().Select(CreateSummaryOutput).ToArray()));
        }