public InvalidFixture(Type innerType, Exception ex) { Key = innerType.Name.Replace("Fixture", ""); var message = "Fixture {0} could not be loaded".ToFormat(innerType.FullName); _error = new GrammarError {error = ex.ToString(), message = message}; }
public Sentence(string template, IEnumerable <Cell> cells) { _cells = new List <Cell>(cells); try { new DisplayParser(this).Parse(template, new Step(), cells); IEnumerable <Cell> resultCells = cells.Where(c => c.IsBooleanResult()); if (resultCells.Count() == 1) { _resultCell = resultCells.First(); _isFact = !_parts.Select(x => x as TextInput).Any(x => x != null && x.Cell == _resultCell); } } catch (Exception e) { var error = new GrammarError { Message = e.Message, Node = this }; logError(error); } _template = template; Name = _template.Replace("{", "").Replace("}", ""); }
public Sentence(string template, IEnumerable<Cell> cells) { _cells = new List<Cell>(cells); try { new DisplayParser(this).Parse(template, new Step(), cells); IEnumerable<Cell> resultCells = cells.Where(c => c.IsBooleanResult()); if (resultCells.Count() == 1) { _resultCell = resultCells.First(); _isFact = !_parts.Select(x => x as TextInput).Any(x => x != null && x.Cell == _resultCell); } } catch (Exception e) { var error = new GrammarError { Message = e.Message, Node = this }; logError(error); } _template = template; Name = _template.Replace("{", "").Replace("}", ""); }
public InvalidFixture(Type innerType, Exception ex) { Key = innerType.Name.Replace("Fixture", ""); var message = "Fixture {0} could not be loaded".ToFormat(innerType.FullName); _error = new GrammarError { error = ex.ToString(), message = message }; }
public void LogError(Exception exception) { var error = new GrammarError { ErrorText = exception.ToString(), Message = "Fixture '{0}' could not be loaded".ToFormat(_name), Node = this }; _errors.Add(error); }
public GrammarErrorItem(GrammarError error) : this() { label.Content = error.Message; if (error.ErrorText.IsEmpty()) { errorText.Hide(); } errorText.Text = error.ErrorText; }
public void LogError(GrammarError error) { _errors.Add(error); }
protected void logError(GrammarError error) { _errors.Add(error); }
public void SetUp() { fixture = new BadGrammarFixture(); error = fixture.Errors.First(); }