Beispiel #1
0
        public void WhenIParseTheFile()
        {
            var contentReader = new StringReader(gherkinContent);

            try
            {
                feature = parser.Parse(contentReader, "sample.feature");
            }
            catch(SpecFlowParserException ex)
            {
                parsingErrors = ex;
                Console.WriteLine("-> parsing errors");
                foreach (ErrorDetail errorDetail in parsingErrors.ErrorDetails)
                {
                    Console.WriteLine("-> {0}:{1} {2}", errorDetail.Line, errorDetail.Column, errorDetail.Message);
                }
            }
        }
Beispiel #2
0
        public void ParseFile()
        {
            var contentReader = new StringReader(FileContent);
            ParsedFeature = null;
            ParsingErrors = null;

            try
            {
                ParsedFeature = parser.Parse(contentReader, "sample.feature");
                Assert.IsNotNull(ParsedFeature);
                ParsedFeature.SourceFile = null;
            }
            catch (SpecFlowParserException ex)
            {
                ParsingErrors = ex;
                Console.WriteLine("-> parsing errors");
                foreach (ErrorDetail errorDetail in ParsingErrors.ErrorDetails)
                {
                    Console.WriteLine("-> {0}:{1} {2}", errorDetail.Line, errorDetail.Column, errorDetail.Message);
                }
            }
        }