Пример #1
0
        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};
        }
Пример #2
0
        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("}", "");
        }
Пример #3
0
        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
            };
        }
Пример #5
0
        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);
        }
Пример #6
0
        public GrammarErrorItem(GrammarError error)
            : this()
        {
            label.Content = error.Message;

            if (error.ErrorText.IsEmpty())
            {
                errorText.Hide();
            }

            errorText.Text = error.ErrorText;
        }
Пример #7
0
 public void LogError(GrammarError error)
 {
     _errors.Add(error);
 }
Пример #8
0
 protected void logError(GrammarError error)
 {
     _errors.Add(error);
 }
Пример #9
0
 public void SetUp()
 {
     fixture = new BadGrammarFixture();
     error = fixture.Errors.First();
 }
Пример #10
0
 public void LogError(GrammarError error)
 {
     _errors.Add(error);
 }
Пример #11
0
        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);
        }
Пример #12
0
 protected void logError(GrammarError error)
 {
     _errors.Add(error);
 }