Example #1
0
 public void Scan(TextReader stream)
 {
     var feature = stream.ReadToEnd();
     var lexer = new I18nLexer(new GherkinListener(_listener));
     try
     {
         lexer.scan(feature);
     }
     catch (LexerError e)
     {
         throw new ParseException(e.Message, e);
     }
 }
Example #2
0
 public void PerformanceTest()
 {
     listener = new DummyListener();
     lexer = new I18nLexer(listener);
     //simple perf test, runs around 390ms om my machine.
     const string words = TestData.AcceptanceTest;
     lexer.scan(words);
     var str = "";
     for (int i = 0; i < 1000; i++)
         str += TestData.AcceptanceTest + "\n";
     var t = new Stopwatch();
     t.Start();
     lexer.scan(str);
     t.Stop();
     Assert.That(t.ElapsedMilliseconds, Is.LessThan(0));
 }
Example #3
0
 public void Setup()
 {
     listener = MockRepository.GenerateMock<IListener>();
     lexer = new I18nLexer(listener);
 }