Пример #1
0
        private void SerializeDocument(SpecFlowDocument feature, TextWriter writer)
        {
            var oldFeature = CompatibleAstConverter.ConvertToCompatibleFeature(feature);

            oldFeature.SourceFile = null;
            XmlSerializer serializer = new XmlSerializer(typeof(Feature));

            serializer.Serialize(writer, oldFeature);
        }
Пример #2
0
        public static List <Feature> GetParsedFeatures(IEnumerable <string> featureFiles, CultureInfo featureLanguage)
        {
            List <Feature> parsedFeatures = new List <Feature>();

            foreach (var featureFile in featureFiles)
            {
                SpecFlowGherkinParser parser = new SpecFlowGherkinParser(featureLanguage);
                using (var reader = new StreamReader(featureFile))
                {
                    var specFlowFeature   = parser.Parse(reader, featureFile);
                    var compatibleFeature = CompatibleAstConverter.ConvertToCompatibleFeature(specFlowFeature);
                    parsedFeatures.Add(compatibleFeature);
                }
            }
            return(parsedFeatures);
        }