public void read_a_fixture_failure() { var exception = new NotImplementedException(); builder.LogFixtureFailure("bad fixture", exception); FixtureGraph fixture = builder.Library.FixtureFor("bad fixture"); fixture.AllErrors().Count().ShouldEqual(1); GrammarError error = fixture.AllErrors().First(); error.Message.ShouldEqual("Fixture 'bad fixture' could not be loaded"); error.ErrorText.ShouldEqual(exception.ToString()); }
/// <summary> /// Gets a converted <typeparamref name="QType"/> object from the specified ALex string. /// </summary> /// <param name="aLexQuery">The ALex query.</param> /// <returns></returns> public virtual QType ParseToQuery(string aLexQuery) { var parsed = this.Parser.Parse(aLexQuery); if (parsed.HasErrors()) { var builder = new System.Text.StringBuilder("There are errors in the parser:\n"); foreach (var item in parsed.ParserMessages) { builder.AppendLine(item.Message); } var grammarError = new GrammarError(GrammarErrorLevel.Error, parsed.ParserMessages[0].ParserState, parsed.ParserMessages[0].Message); var ex = new GrammarErrorException(builder.ToString(), grammarError); throw new ALexException(builder.ToString(), 10, ex); } var result = this.GetQuery(parsed); return(result); }